Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Distributed Load Testing using Apache JMeter

Overview

Distributed Load Testing is a process of simulating very high work load of enormous number of users using multiple systems. As a single system cannot generate large number of threads (users), multiple systems are used for load testing. It helps to distribute the tests and the load.

Apache Jmeter, an open source testing tool, is used for load testing, performance testing, and functional testing. In JMeter, Master-Slave configuration is used for achieving load testing. Distributed load testing is bit tricky and can provide inaccurate results if not properly configured.

In this blog, let us discuss about setting up distributed testing with JMeter.

Pre-requisites

  • Download and install Apache JMeter from the following link:
    http://jmeter.apache.org/download_jmeter.cgi
  • Ensure that all the test machines are on the same subnet
  • Ensure that the same version of Apache JMeter is installed on all the machines
  • Ensure that the same version of Java is installed on all the machines
  • Disable firewall or designate it with a proxy supporting RMI protocol
  • Ensure correct system configurations such as RAM, processor, and so on

Use Case

A single Apache JMeter master instance is used to control multiple remote JMeter slave instances and to generate large volume of load on the test application.

The distributed test environment is as follows:

Performing Distributed Load Testing

To do distributed load testing, perform the following:

Starting JMeter Server in Master and Slave systems

To start the jmeter-server.bat in both master and slave systems, perform the following:

  • Click JMeter home directory –> Bin folder.
  • Run the batch file – jmeter-server.bat (for Windows) or jmeter-server (for Linux) as shown in the below diagram:

Note: If you are unable to run test form in Remote machine and get the below error, check whether jmeter-server.bat file is running on remote system:

Setting IP Addresses for Slave Systems

To set the IP addresses for slave systems, perform the following:

  • From the master system, open the properties file – jmeter.properties
  • Remove the current IP for remote_host entry
    For example, remove the IP address – 127.0.0.1
  • Specify the IP addresses of all the Remote systems separated by commas
    For example, 192.168.0.1,192.168.0.2 as shown below:

Starting Slave Systems Remotely

To remote start all the slave systems in JMeter, perform the following:

  • Open JMeter in the Master machine (on which properties files are edited)
  • Open your test script and Remote Start all the slave systems as shown below:

Creating Test Plan in JMeter

To create test plan in JMeter, perform the following:

  • Create a JMeter Thread Group and mention the number of threads, loop count, and ramp-up period as shown in the below diagram:

  • In the Thread Group, add JMeter config element as HTTP request defaults and provide source URL and port number as shown in the below diagram:

  • Add HTTP Request in the test plan thread group and mention the tested URL followed by the specific path as shown in the below diagram:

  • Add the Duration Assertion to validate each response received within a given period.
  • Add the Response Assertion to verify different segments of the response such as text (response body), document (doc, PDF), response code (200, 404), response message (description of code), and response headers.

  • Add the listener to check the test plan results for all the formats.

Viewing Results

Table View

The results can be viewed in table format as shown in the below diagram:

Response Time Graph View

The results can be viewed in the form of chart as shown in the below diagram:

Conclusion

In this blog, we discussed about setting up distributed testing with JMeter, creating test plan, and viewing results in JMeter.

References

  • Apache JMeter:
    http://jmeter.apache.org/
  • Apache JMeter Remote Testing:
    http://jmeter.apache.org/usermanual/remote-test.html
  • Apache JMeter Wiki:
    https://wiki.apache.org/jmeter/JMeterFAQ#How_to_do_remote_testing_the_.27proper_way.27.3F


This post first appeared on Front-end Code Review & Validation Tools | Treselle Systems, please read the originial post: here

Share the post

Distributed Load Testing using Apache JMeter

×

Subscribe to Front-end Code Review & Validation Tools | Treselle Systems

Get updates delivered right to your inbox!

Thank you for your subscription

×