Using jmeter for web loadtesting

This Article will help the novice users to use JMeter for load testing their web application.  Most web applications failures are because of performance issues, so it is a must that you have a performance requirement to  your product.  There are a lot of tools available in the industry for performance tuning / testing, but most of them are too costly to be implemented by smaller companies.  Open source products like JMeter is one of the products, in which you can do some basic load testing of your product, but without the hefty price tag.

Hopefully this will help you get started on the basic flow of using JMeter once you have gone through the article in its entirety and exploring the tool for yourself.

Download JMeter from the link:

Once downloaded, extract the zip file and go to the bin folder, where you will find the jmeter.exe file.  Double-click on that file.  In the JMeter window tree view you will find two items: workbench and test plan.  Workbench is usually used to test and create components of your test. Test Plan is used to run the tests using the components created in the Workbench.

Note: in order to run jmeter.exe, you need to have installed a Java Developer's Kit (JDK) and configured the JDK bin in your system's PATH environment variable.

Proxy Server
JMeter supports recording of the user action.  This is done with the help of the proxy server of JMeter.  To create the proxy server, right-click on the Workbench and go to "non test elements", then add a proxy server and provide the required port number (default 8080).  Now go to your web browser and change your connection settings so that each HTTP request you make will be tunnelling through the JMeter proxy and gets recorded.

Settings can be done as below.

Internet Explorer
Tools->Internet Options->Connections->Proxy Settings
here put localhost as host and port that you have given in JMeter proxy (default 8080)

Tools->Advanced->Network->Connection->Proxy Settings
here put localhost as host and port that you have given in JMeter proxy (default 8080)

Recording a user action
Once the settings are done, you have to start the JMeter proxy server, go to the browser in which you have made the proxy settings and access your web site on which you have to run the test, doing the necessary action(s) which you consider "business critical" or in which your are expecting some system failure.  These action(s) will be recorded in the workbench.

Playback settings
Now go to Test Plan in the tree view window and right-click then create a new ThreadGroup.  Cut all the components from workbench and paste it to this new ThreadGroup.  In the ThreadGroup, you can mention the number of times the use case needs to be executed in "Loop Count", the number of parallel users in "Number of Threads" and the time gap between which users are introduced to system in "Rampup" setting.

Results Aggregation
once these settings are done you need to add a aggregate graph to view the results (number of hits and misses) by right-clicking on the ThreadGroup and selecting add->listener->aggregate graph.

To start the test go to run menu and select start.

This ends the basic flow of using JMeter.  Along with this, you can use some profiler tools to profile your product if you find some issues while doing the load test.  Please continue to explore for yourself, as there is more to this tool than covered in this basic usage guide.  You will find JMeter supports most of the features that other licensed load testing products support apart from that it is not UI rich.


Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.