Introduction to Apache JMeter

Apache JMeter

Apache JMeter is open source desktop application purely built on java designed to do load test functional behavior of an application and measure performance. It may be used to load test both static and dynamic resources such as static files, Java Servlets, CGI scripts, Java objects, databases, FTP servers, and more. JMeter can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types.

Additionally, JMeter can help you regression test your application by letting you create test scripts with assertions to validate that your application is returning the results you expect. For maximum flexibility, JMeter lets you create these assertions using regular expressions.

JMeter is not a “Browser”

JMeter is not a browser. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the JavaScript found in HTML pages. Nor does it render the HTML pages as a browser does (it’s possible to view the response as HTML etc, but the timings are not included in any samples, and only one sample in one thread is ever viewed at a time).

 Why Apache JMeter?

 Apache JMeter has wide variety of features to load test an application, let’s have a glance at these features in detail:

  • JMeter has an ability to load and performance test variety of protocol types such as Web – HTTP, HTTPS, SOAP, FTP, Database via JDBC, LDAP, Message-oriented middleware (MOM) via JMS, Mail – SMTP(S), POP3(S) and IMAP(S), MongoDB (NoSQL), Native commands or shell scripts, TCP.
  • Complete portability and 100% Java purity.
  • Full multi-threading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.
  • Careful GUI design allows faster Test Plan building and debugging.
  • Caching and offline analysis/replaying of test results.
  • Highly Extensible core
  • Pluggable Samplers allow unlimited testing capabilities.
  • Several load statistics may be chosen with pluggable timers.
  • Data analysis and visualization plug-ins allow great extensibility as well as personalization.
  • Functions can be used to provide dynamic input to a test or provide data manipulation.
  • Scriptable Samplers (Bean Shell, BSF-compatible languages and JSR223-compatible languages)

 Jmeter Installation

Apache Jmeter installation is extremely easy and very simple. Let’s see how we can install on a windows operating system:

Install Java:

Since JMeter is 100% Java application and should run correctly on any system that has a compliant Java implementation. So, it is mandatory that a fully compliant JVM 6 or higher versions is installed. You can download and install the latest version of Java SE Development Kit here.  After installation, we should make sure that JDK installation is successfully and to do that follow the below procedure:

  • In windows, open command prompt.
  • Navigate to java installation folder and enter java –version command


If above output is not displayed, please re-install Java SE runtime environment.

 Download Jmeter:

You can download the latest version of Apache Jmeter here .



After downloading Apache JMeter, simply unzip the zip/tar into a location where you intend to install. Provided that you have a JRE/JDK correctly installed and the JAVA_HOME environment variable is set, there is nothing more for you to do. After unzipping installation directory structure should look like this :


If the folder structure is not same as in the above screenshot after the installation, it is advisable to re install the Apache JMeter again. Lets briefly understand what each directory does and its importance:

/bin: Contains JMeter script file for starting, stopping JMeter. And also
contains all the property files which instructs JMeter to act accordingly.
/docs: Contains the APIs, css and screenshots used in JMeter.
/extras: Contains files related to extra addons that can be used in 
JMeter for instance ANT etc. ANT is a build tool that can be used to start
JMeter and also to generate basic html reports.
/lib/: Contains all the JAR files related to all the elements configured 
in the JMeter.
/lib/ext: Contains the core jar files for JMeter and the protocols.And also
if you want to add any custom plugins other than predefined, this should be
the directory that comes handy.
/lib/junit: JMeter supports Junit testing.This directory basically contians
all the JUnit class files bundled up in a JAR which are to be tested.

Launch Apache JMeter

You can launch JMeter in different modes, depending upon the requirement you can chose the mode to launch. Our dear friend blazemeter here explained very clearly about various ways of launching JMeter in non gui mode here. I will walk you thorough the basic modes to launch JMeter. Modes can be as follows:

1.GUI Mode
2.Server Mode
3.Command Line Mode
Launch JMeter in GUI Mode

It is very easy to launch JMeter in a GUI mode. If you are working on a Window machine, navigate to /bin/ directory of the JMeter installation path. And then run jmeter.bat to start JMeter in GUI mode. Following figure denotes JMeter GUI:


Launching JMeter in GUI mode consumes more CPU, Memory.

Start JMeter in Server Mode

Server mode is used for distributed testing. Distributed testing is basically a master-slave model where the master has the control over all the slave systems and instructs slave systems to run the tests. In this model, JMeter runs on server computer in server mode. On client computer, JMeter runs in GUI mode. To start the JMeter in server mode, navigate to /bin/ directory of the JMeter installation path and then run jmeter-server.bat. 


Start JMeter in command line mode

JMeter in GUI mode consumes much computer memory. For saving resource, you may choose to run JMeter without the GUI. To do so, use the following command options

jmeter -n -t testPlan.jmx - l log.jtl -H -P 8000

-n : This specifies JMeter is to run in non-gui mode
-t : name of JMX file that contains the Test Plan.
-l : name of JTL file to log sample results to.
-j : name of JMeter run log file.
-r : Run the test in the servers specified by the JMeter property “remote_hosts”
-R: [list of remote servers] Run the test in the specified remote servers
-H : proxy server hostname or ip address
-P : proxy server port

JMeter Command line options

As we have learnt that JMeter can be started in command line mode, it provides wide variety of command line options which can be used in combinations to invoke JMeter. Lets have a look at the options and understand the functionality of each option:

-h, --help : print usage information and exit
-v, --version : print the version information and exit
-p, --propfile {argument} : the jmeter property file to use
-q, --addprop {argument} : additional property file(s)
-t, --testfile {argument} : the jmeter test(.jmx) file to run
-j, --jmeterlogfile {argument} : the jmeter log file
-l, --logfile {argument} : the file to log samples to
-n, --nongui : run JMeter in nongui mode
-s, --server : run the JMeter server
-H, --proxyHost {argument} : Set a proxy server for JMeter to use
-P, --proxyPort {argument} : Set proxy server port for JMeter to use
-u, --username{argument} : Set username for proxy server that JMeter is to use
-a, --password {argument} : Set password for proxy server that JMeter is to use
-J, --jmeterproperty {argument}={value} : Define additional JMeter properties
-G, --globalproperty (argument)[=(value)] : Define Global properties (sent to servers) : e.g. -Gport=123 or
-D, --systemproperty {argument}={value} : Define additional System properties
-S, --systemPropertyFile {filename} : a property file to be added as System properties
-L, --loglevel {argument}={value} : Define loglevel: [category=]level : e.g. jorphan=INFO or jmeter.util=DEBUG
-r, --runremote (non-GUI only) : Start remote servers (as defined by the jmeter property remote_hosts)
-R, --remotestart server1,... (non-GUI only) : Start these remote servers (overrides remote_hosts)
-d, --homedir {argument} : the jmeter home directory to use
-X, --remoteexit : Exit the remote servers at end of test (non-GUI)

Logging and Error Messages

JMeter does not generally use pop-up dialog boxes for errors, as these would interfere with running tests. Nor does it report any error for a mis-spelt variable or function.

If JMeter detects an error during a test, a message will be written to the log file. The log file name is defined in the file (or using the -j option, see below). It defaults to jmeter.log , and will be found in the directory from which JMeter was launched. The menu Options > Log Viewer displays the log file in a bottom pane on main JMeter window. In the GUI mode, the number of error/fatal messages logged in the log file is displayed at top-right.


The command-line option -j jmeterlogfile allow to process after the initial properties file is read, and before any further properties are processed. It therefore allows the default of jmeter.log to be overridden. When running on Windows, the file may appear as just jmeter unless you have set Windows to show file extensions. The log file can be helpful in determining the cause of an error, as JMeter does not interrupt a test to display an error dialogue.

Overriding properties via command line

Java system properties, JMeter properties, and logging properties can be overridden directly on the command line (instead of modifying To do so, use the following options:

-D[prop_name]=[value] – defines a java system property value.
-J[prop name]=[value] – defines a local JMeter property.
-G[prop name]=[value] – defines a JMeter property to be sent to all remote servers.
-G[propertyfile] – defines a file containing JMeter properties to be sent to all remote servers.
-L[category]=[priority] – overrides a logging setting, setting a particular category to the given priority level. Can also be used without the category name to set the root logging level.


jmeter -Jremote_hosts= -Ljmeter.engine=DEBUG

Additional Packages

You can always downloads jMeter custom plugins here. Only thing you needed to do is extract the downloaded contents and place the “.jar”  files under “Jmeter_installation_Path\lib\ext“. Then restart your jmeter instance. That’s it adding custom plug-ins is quite simple!!

Use JMeter in Linux

Launching JMeter in linux is same as windows but instead of running batch(.bat) files we should run shell(.sh) scripts:

jmeter – run JMeter (in GUI mode by default). Defines some JVM settings which may not work for all JVMs.
jmeter-server – start JMeter in server mode (calls JMeter script with appropriate parameters) – very basic JMeter script with no JVM options specified. – runs the JMeter Mirror Server in non-GUI mode – Run the Shutdown client to stop a non-GUI instance gracefully – Run the Shutdown client to stop a non-GUI instance abruptly

Hope the above content is helpful, Please subscribe this blog for further notifications.

🙂 Happy Performance Testing !!!  🙂


15 thoughts on “Introduction to Apache JMeter

  1. Nicеe pοst. I was checking cߋntinuouslу this blog and I’m impresseԀ!
    Extremely helpful info speciаlly the lаst part :)I care for such infо much.
    I was looking fοr this certain information for a very long time.
    Thank you and best of luck.

  2. Just want to say your article is as amazing. The clarity in your post is just
    excellent and i could assume you’re an expert on this subject.

    Fine with your permission allow me to grab your RSS feed to keep updated with forthcoming post.
    Thanks a million and please carry on the enjoyable work.

  3. Hi there! Your websites are running slowly to me, it took like a minute or two to load up,
    I actually dont know whether it is just simply me or
    maybe your web site on the other hand facebook loaded acceptable for me.
    Anyways, I’m going to thank you for attaching beautiful post.
    Perhaps it has been useful to many people . This one is incredibly good everything that you have implemented
    and would like to discover even more content from you. Right after looking at
    the articles, I have book-marked your web page.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s