A quick guide to implementing Apache JMeter Distributed Testing Step-by-step

Updesh Kumar Singh
3 min readJan 18, 2022

--

Photo by Ilya Pavlov on Unsplash

This short tutorial explains how to use multiple systems to perform stress testing. Before we start, there are a couple of things to check.

  1. The firewalls on the systems are turned off or correct ports are opened.
  2. All the clients are on the same subnet.

The server is in the same subnet if 192.x.x.x or 10.x.x.x IP addresses are used. If the server doesn’t use 192.xx or 10.xx IP address, there shouldn’t be any problems.

  1. Make sure JMeter can access the server.
  2. Make sure you use the same version of JMeter and Java on all the systems. Mixing versions will not work correctly.
  3. You have set up SSL for RMI or disabled it.

Once you’ve made sure the systems are ready, it’s time to set up remote testing. The tutorial assumes you already have JMeter installed on all the systems.

The way JMeter works is one controller node initiates the test on multiple worker nodes.

Things to understand before moving to Apache JMeter Distributed Testing

Controller Node

The system runs JMeter GUI, which controls the test.

Worker Node

the system running jmeter-server, which takes commands from the GUI and send requests to the target system(s)

Target

the webserver we plan to stress test

Categories of systems

Further Steps

  1. On the worker nodes, go to jmeter/bin directory and execute jmeter-server.bat (jmeter-server on Unix).
  2. On controller node acting as the console, open windows explorer and go to jmeter/bin directory
  3. Open jmeter.properties in a text editor
  4. Edit the line remote_hosts=127.0.0.1
  5. Add the IP address. For example, if I have JMeter server running on 192.168.0.10, …, 192.168.0.15, the entry would look like this -

6. Start JMeter.

7. Open the test plan you want to use

Simple test plan

Things to check before starting the tests

At this point, you are ready to start load testing. If you want to double check the worker nodes are working, open jmeter.log in your editor. You should see the following in the log.

If you do not see this message, it means jmeter-server did not start correctly.

Two ways we can initiate the test:

Single system

All systems.

Start a single client-

  1. Click Run at the top
  2. Select Remote Start
  3. Select the IP address
Start a single worker node

Start all clients

  1. 1. Click Run at the top
  2. Select Remote Start all or use Ctrl + Shift + R
Start all worker nodes

Limitations

Every system has some limitations and JMeter is no exception.

  1. A single JMeter client running on a 2–3 GHz CPU (recent CPU) can handle 1000–2000 threads depending on the type of test.
  2. RMI cannot communicate across subnets without a proxy; therefore neither can JMeter without a proxy.
  3. JMeter sends all the test results stripping Response data to the controlling console, this allows us to reduce the impact on network IO. Ensure you monitor your network traffic so that this traffic does not incur contention

--

--