Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Distributed Load Testing Using Apache JMeter

DZone's Guide to

Distributed Load Testing Using Apache JMeter

Learn to install, set up, and view results from the open source testing tool Apache JMeter on remote systems for distributed load testing.

Free Resource

Download the blueprint that can take a company of any maturity level all the way up to enterprise-scale continuous delivery using a combination of Automic Release Automation, Automic’s 20+ years of business automation experience, and the proven tools and practices the company is already leveraging.

Overview

Distributed load testing is the process of simulating a very high workload of an enormous number of users using multiple systems. As a single system cannot generate a 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, a 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 setting up distributed testing with JMeter.

Pre-Requisites

  • Download and install Apache JMeter from this link.
  • 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 the 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 a large volume of load on the test application.

The distributed test environment is as follows:select

Performing Distributed Load Testing

To do distributed load testing, perform the following:

Start 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:

selectNote: If you are unable to run test forms in remote machines and get the below error, check whether jmeter-server.bat file is running on the remote system:select

Set 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:

select

Start Slave Systems Remotely

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

  • Open JMeter in the Master machine (on which properties file are edited).
  • Open your test script and Remote Start all the slave systems.

Creating the Test Plan in JMeter

To create the test plan in JMeter, perform the following:

  • Create a JMeter Thread Group and mention the number of threads, loop count, and ramp-up period.
  • In the Thread Group, add JMeter config element as HTTP request defaults and provide source URL and port number.
  • Add HTTP Request in the test plan thread group and mention the tested URL followed by the specific path.
  • 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.

View Results

Table View

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

Response Time Graph View

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

Download the ‘Practical Blueprint to Continuous Delivery’ to learn how Automic Release Automation can help you begin or continue your company’s digital transformation.

Topics:
load testing ,jmeter ,distributed system ,database testing ,visualization ,devops

Published at DZone with permission of Rathnadevi Manivannan. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}