How to get started with Apache JMeter?

JMeter is an intuitive tool or framework for performing load tests for any website. This is an open source initiative from Apache foundation. We can easily simulate load testing using this tool and analyze various parameters such as throughput, deviations etc…

Configure JMeter: Step by Step

These are the following steps needed to be performed to configure Apache JMeter:

Step 1: Download the binaries

Download the JMeter from its site to local drive.

Step 2: Unzip the content

Then unzip the content to a folder and navigate to the bin folder.

Location for JMeter installation
Fig 1: Location for JMeter installation

Location for JMeter executable
Fig 2: Location for JMeter executable

Then click on the ‘jmeter’ executable file. This will start the JMeter desktop application for further use.

Step 3: JMeter Configuration for load test

If you click the JMeter executable file, you will get the following screen which means that the JMeter application is started. Now, we are going to do some configuration in the JMeter.

JMeter test plan window
Fig 3: JMeter test plan window

Next, right click on ‘Test plan` and create a thread group like this:

JMeter screen to select Thread Group
Fig 4: JMeter screen to select Thread Group

Now enter the following details on the next screen:

JMeter thread group screen
Fig 5: JMeter thread group screen

We have selected 1000 users and the duration is 30 minutes (1800 seconds). This will perform the load test for 30 minutes while simulating 1000 users. However, we can change this value as per the requirement.

Next, let’s configure HTTP request details for the load test. Right click on the Thread Group and add a HTTP Request sampler as shown below:

Thread Group -> Add -> Sampler -> Http Request

This will open up another screen where we are going to enter the HTTP request details.

JMeter menu to select HTTP request sampler
Fig 6: JMeter menu to select HTTP request sampler

These are the following http request details we are going to enter in this JMeter screen

JMeter HTTP Request screen
Fig 7: JMeter HTTP Request screen

Next step is to gather the following attributes:

Protocol: http
Server name: localhost or your server ip address
Port:8080 (This is default in case of Java web based application)
Path: application endpoint

Next, let’s include a Graph Results Listener, just like it is shown below:

JMeter menu to select Graph result
Fig 8: JMeter menu to select Graph result

Http Request -> Add -> Listener -> Graph Results

This diagram illustrates how load testing looks graphically when it happens.

JMeter graph result window
Fig 9: JMeter graph result window

After all these configurations, we can click on the right arrow button on the menu panel. This will begin the load test.

Note: Also, it is mandatory to start the web application before starting the JMeter load test.

Test for 1000 users using native threads

We configured the JMeter for 1000 users in the above steps and when we start the load test you can see something happens in the  graphical results section of the HTTP Request Sampler. These are the graphical representation for throughput, deviation and average while handling the requests.

JMeter load test Graphical display
Fig 10: JMeter load test Graphical display

That is all. We have set up the JMeter and configured how to use it. This is an amazing framework and it has got a lot of functionalities in the load testing arena.

Share your Thoughts!

Up ↑

Index

Discover more from yCrash

Subscribe now to keep reading and get access to the full archive.

Continue reading