JMeter Introduction - free website performance test

Introduction to JMeter

In this introduction to JMeter, we will cover the below topics:

  1. A Brief About  JMeter

  2. Interesting Facts of JMeter

  3. Capabilities of JMeter

  4. Scope of JMeter

  5. Download and Install JMeter

  6. JMeter First Look

JMeter Introduction - free website performance test


A Brief About JMeter

Apache JMeter is free and open source Performance testing tool written in Java. Hence, JMeter is one of the tool typically used to do free website performance test to measure the web page performance. The first version of JMeter was introduced in Dec 15, 1998 by Stefano Mazzocchi. It’s a great tool for performance testing and widely used in the market as compared to other performance testing tools.

It can be used for different types of performance test, which includes:

  • Load test
  • Stress test
  • Endurance test
  • Volume test
  • Spike test


Interesting Facts of JMeter

  • Open source under GPL license – JMeter built by Apache under GPL compatible license, which makes it free and open source. Without any licensing constraint you can use and tweak it. Due to this companies using JMeter for performance testing has increased the scope of job opportunities.
  • Script without coding it – You will find it interesting that JMeter scripts are platform independent. Scripts are not written in Java or any other language. Instead, scripts are created in XML format, which could easily be transported to any machine.
  • Easy to learn – There are a lot of people having a fear that JMeter is a hard tool to learn, trust me you don’t have to be a superman to learn JMeter. JMeter is actually one of the simplest tools to learn.


Capabilities of JMeter

JMeter has all the capabilities of performance testing tool it could create complex scripts, generating huge load or creating reports.

  • Complex scripts made easy with powerful GUI – You can create complex scripts using conditions, looping, validations, logic etc. with a wide range of controllers in JMeter. You could also write custom code within the script if required.
  • Unlimited load generation – You can generate unlimited number of virtual users. But at the same time you have to acquire enough hardware for JMeter to generate virtual users.
  • Extensive reporting metrics – JMeter gives lot of information to evaluate on the performance of the application which includes response time, errors, standard deviation, 90 percentile, throughput, response message, response code and other useful information.
  • Automate multiple protocols – JMeter supports a wide range of protocols like http/https, FTP, REST / SOAP, JDBC, LDAP, JMS, POP3, SMTP, IMAP, TCP, Shell scripts, Java objects etc.
  • Easy to develop JMeter plugins – JMeter allows to add custom features without editing anything in the code but by just creating the custom plugins


Scope of Jmeter

Like any other tool, there are some limitations with JMeter as well. Performance testing of below mentioned applications is not possible through JMeter

  • SAP
  • Oracle EBS
  • RDP
  • Desktop applications
  • Citrix
  • Flex

There is a company, Ubikloadpack that gives support to some additional protocols by their paid plugins like FLEX / Adobe AIR, video streaming, GWT Plugin etc.

Though JMeter gives you reporting feature but that is not very rich and interactive as compared to other paid tools, but if you use SAAS service like LoadSkull or Blazemeter you could get nice graphs and interactive reporting.

As JMeter support http and other mostly used protocols. It captures the huge market and services like LoadSkull whichmakes it easy to use by eliminating the limitations of JMeter


Let’s download and install JMeter

You can download JMeter directly from Apache JMeter website . Download the binaries Zip file for windows, not the source.

It’s only a few Mbs in size. Once it is downloaded, you just have to unzip it and you are good to go.

NOTE: As JMeter is written in java, you must have Java installed on your machine to run JMeter. In some cases, you may also have to add Java path into environment variables.

One’s it’s done you are good to start with JMeter. JMeter GUI is very easy to use and can easily be learned.

How to Configure JMeter in Eclipse

Complete end to end configuration of JMeter in Eclipse

Here we will learn how to Configure JMeter in Eclipse. If you are planning to do some customization in JMeter, then, you must be thinking of using some IDE like Eclipse because a lot can be done using an IDE.

There are a lot of blogs and tutorials on this topic, but share partial information regarding End to End configuration.


This is a long post with series of configuration, but resolves all the problem you may face with Eclipse and JMeter Integration, for ease of reading it is divided into three parts:

  1. Import JMeter Source into Eclipse
  2. Run JMeter using ANT target
  3. Settings to Properly Configure JMeter in Eclipse


1. Import JMeter Source into Eclipse

For that, you will have to first configure JMeter source in some IDE like eclipse.

  • First, create a Java project

Create Java Project

Create Java Project Finish

  • Import JMeter source into the recently created Java project

 Import JMeter Source


Import JMeter Source 2

Now, we have successfully imported the JMeter source in Eclipse. Now, let’s launch the JMeter.


2. Run JMeter using ANT target

There are two ways to launch JMeter:

  • Standard method – Using Command line, the most common way to launch JMeter
  • Using ANT Target – JMeter contains ANT target to launch JMeter

We have an ANT target in JMeter that makes this task really easy. So, we will use the second method (Using ANT Target) to launch JMeter

NOTE: You just need the ANT plugin installed in eclipse to take advantage of ANT. You need to have Ant (Version 1.9.6) in your IDE

To use targets define build.xml, let’s first add the build.xml files to Ant window in Eclipse.

There are two build.xml files, one is in “root” folder and another is in “extras” folder. Add both these build.xml files.

Add Build.xml

Now, use the ANT Target (run) defined in build.xml file kept in “extras” folder

As soon as you execute the “run” target you will see errors in the src folder and JMeter will not launch.


Now, to resolve these issues we have to do some more configuration. Let’s move to the 3rd part of the post


3. Setting to Properly Configure JMeter in Eclipse

You will face few challenges in the smooth running of JMeter project in Eclipse. We will now see the solutions to these challenges.

Challenge 1:

Eclipse creates some files and folders when you create a Java Project in Eclipse that includes a bin folder. JMeter already has a bin folder that contains important property files and executable to run the JMeter jar file. Eclipse will use same JMeter “bin” folder as output folder (to keep .class files when we build the Java project) because of which Eclipse deletes all the content that is already present in the folder.

Because of this clash, eclipse deletes all the files from this “bin” folder when we build the JMeter project using eclipse.

JMeter Bin Folder Compare

Solution: Change the eclipse output folder

Java Build Path

Change Eclipse Default Bin Folder

Now, copy the missing files from the unzipped JMeter source project to the “bin” folder of eclipse JMeter project, manually.

Bin and Eclipse Bin Folder

Challenge 2: Errors in the Project

You will see errors in the project because of missing JMeter jar files.

Configure JMeter in Eclipse - Errors


To resolve these errors we have to do following 3 steps

1. Download the required “jar” files

2. Configure the Build Path

3. Add Source folders to the build path

Download the required “jar” files

JMeter source does not contain the jar files as a bundle. But that doesn’t mean you have to download it manually or copy paste from the JMeter binary distribution. You can download it in just one click using ANT target.

JMeter uses ANT as a build tool that has different ANT targets for different actions necessary for project building. For example, downloading of all the required jar files.

Now, download the required jar files. There is a download_jar target in build.xml kept in the root folder that downloads all the missing jar files. 

Build.xml download jar files

Configure Build Path

Now, after downloading the jars, you can use source JMeter like you use binary JMeter, but we still see errors in Eclipse even though the jar files are present in the “ext” and “lib” folders now. But these errors are because eclipse doesn’t know from where these jar files need to be picked. That is why eclipse displays these errors.

Now, to fix this we simply have to add all the jar files present in “lib” and “ext” folder into classpath using “Configure Build Path”

JMeter - Configure Buildpath

Once done, we will start seeing intelligence help one’s eclipse know from where these jar files are to be picked.

You may still see few files showing “cross/error” symbol. If you check the error by opening one of those java files you will observe.

Add Source folders to the build path

You will still observe these errors in the Java file related to the wrong package. To resolve this we have to add folders to the build path.

Change in eclipse .property file

Add all these folders to the Java Build Path to resolve the errors.

Configure JMeter in Eclipse - Add Source Folders1


I hope this article was helpful to resolve all the issues you faced with Eclipse and JMeter integration.

Congrats!!… If you have reached the end of this article and JMeter to work smoothly with an IDE without any errors.

If you still facing any issue just write a comment below. I will try my best to help you out.

Configure JMeter to Handle Dynamic IPs and Loadbalancer

Do you see errors in JMeter while executing the performance testing, but not see such errors if you access the website manually during the load testing? If yes, then, there is a possibility you have not properly configured your JMeter script. Let’s configure JMeter to Handle Dynamic IPs and Loadbalancer before putting the load on such website.

This will paint your report red which no one wants as these errors are not related to the Application Under Test (AUT).

If JMeter is not configured properly for such a website then, you may observe the following:

  1. The requests are getting redirected to only one server and the other server is sitting idle while doing the load testing of the website that has multiple servers to balance the requests using a load balancer.
  2. Errors like “Target server failed to respond” or “Your hostname could not be resolved to an IP address” in JMeter or “ Software caused connection abort recv failed”

Here is how the results will look like. See below screenshot and the response data.

Errors due to DNS caching

There are several reasons for this problem like insufficient hardware or generating unrealistic load, but if you think you are generating realistic load using decent hardware, but still getting those error then, Java DNS caching could causing the problem.

DNS Caching problem occurs if there is:

  • a load balancer (for example, CDN)
  • or, IPs are dynamic (for example, services hosted on AWS)


  1. Change the TTL, Java DNS Cache settings
  2. Or, add DNS Cache Manager in JMeter (from JMeter 2.12 the DNS Cache Manager has been included as a configuration element)

Before looking into the solution let us see, how is Java DNS caching related to this problem?

What Java does is, it caches the IP address against each domain name you access and the JVM default TTL is set to never re-resolve DNS names to IP addresses. This means that when the IP address for  resource changes, the application will be unable to connect to that resource until someone manually restarts the JVM so that the new IP addresses can be picked up. In these cases, it is vital that the TTL be configured to a shorter time period, like 60 seconds.

Option 1:

You can configure the TTL in the file, which is located in the directory %JRE%libsecurity. The configured value specifies the number of seconds that the JVM should cache a successful DNS name lookup. Here is an example that shows how to configure the TTL to 60 seconds.



Option 2:

Dzimitry Kashlach created the “DNS Cache Manager” which is available in JMeter 2.12 and later versions. DNS Cache Manager is bundled with JMeter you don’t have to add any additional jar file for this.



  1. Add “DNS Cache Manager” Thread Group or Test Plan
  2. Check “Clear cache each iteration”
  3. It’s done
See the below table for more information on DNS Cache Manager


Attribute Description Required
Name Descriptive name for this element that is shown in the tree. No
Clear cache each Iteration If selected, DNS cache of every Thread is cleared each time new iteration is started. No
Use system DNS resolver System DNS resolver will be used. For correct work edit $JAVA_HOME/jre/lib/security/ and add


Use custom DNS resolver Custom DNS resolver(from dnsjava library) will be used. N/A
Hostname or IP address List of DNS servers to use. If empty, network configuration DNS will be used. No
Add Button Add an entry to the DNS servers table. N/A
Delete Button Delete the currently selected table entry. N/A

Badboy Script Gets Logout in JMeter

Badboy script gets logout in Jmeter just after doing a login transaction?

Did you ever face this issues while running the script in JMeter which was recorded using Badboy tool? If yes, the solution is really simple.
Just open the “HHTP Request” sampler and check the “Follow Redirect” checkbox.

When I first encountered this problem I thought this is some kind of weird issue with JMeter, but made sense when I got to know the reason behind it.

Badboy is a great tool when it comes to recording a flow. But the script that it creates is not exactly same as JMeter creates.

I had used Badboy tool to record the scenario/workflow because of some ajax requests were not getting captured by the JMeter while recording. After recording the workflow in the Badboy tool, I had exported the script as a JMeter file using the Badboy tool itself.

The issue occurred when the script executed in JMeter tool and the issue was when I execute the script it gets logout or redirects to the logout page, each time. To me, that was a weird situation as all the dynamic values were properly correlated.

While doing Google, I came across to this Forum that finally give the answer that solves this.

When you record the script in Badboy and exported to JMeter, by default, the sampler has “redirect automatically” checked by switching that to “follow redirects” the problem will get resolved.

If “Redirect automatically” checkbox is checked then, it sets the underlying HTTP protocol handler to automatically follow redirects.


JMeter - Follow Redirect