Apache JMeter is a prevalent and versatile open-source tool explicitly designed for all-around performance and load testing of applications. One of its key features is the ability to run tests in distributed mode, which allows users to simulate high loads and distribute the workload across multiple machines. You can enhance scalability and achieve optimal application performance by harnessing the power of distributed testing. This article will delve into distributing JMeter tests for improved performance.
Table of contents
- What is distributed testing in JMeter
- Prerequisites
- Configure JMeter properties for distributed testing
- Create a JMeter test plan
- Running a distributed JMeter test
- Analyzing JMeter test results
- Conclusion
What is distributed testing in JMeter
JMeter distributed testing involves utilizing multiple machines, known as remote or slave machines, to execute the load generated by a test plan. A single machine, called the master, coordinates the execution and collects the results from all the remote machines. This distributed setup allows you to simulate larger loads, ensuring your application can handle high traffic volumes and assess performance under realistic conditions.
By distributing the workload, JMeter helps replicate real-world scenarios, enabling you to identify potential bottlenecks and optimize the performance of your application. Additionally, distributed testing allows for better resource utilization and scalability, as the workload is divided among multiple machines.
Prerequisites
- Ensure that JMeter is installed on all machines in the distributed test environment. See our article on How to Install JMeter on Windows and Mac.
Once installed, designate one machine as the master and the rest as slaves. - Turn off any firewalls. Otherwise, you will need to ensure that the required ports will be opened during testing.
- Locate the rmi_keystore.jks file in your JMeter installation bin folder on each machine that will be used for distributed testing. If it’s not present, you can generate it using the Keytool utility provided with Java as follows:
- Open a command prompt or terminal.
- Navigate to the JMeter’s bin folder.
- Run the following command and follow the prompts to provide the necessary information to generate the keystore file:
keytool -genkey -alias rmikey -keyalg RSA -keystore rmi_keystore.jks -validity 7 -keysize 2048
Configure JMeter properties for distributed testing
On the master machine, locate the jmeter.properties
file in the bin folder. Edit the remote_hosts
property in this file and specify the IP addresses of the slave machines. Separate multiple IPs with commas as follows:
remote_hosts=192.168.1.20,192.168.1.21
To make things easier, it is also recommended to disable SSL for RMI in the same properties file as follows:
server.rmi.ssl.disable=true
Save the file and restart JMeter if necessary.
The master machine acts as the control center, coordinating the test execution and aggregating the results from the slave machines. The slave machines, on the other hand, perform the actual load generation based on the instructions received from the master.
Create a JMeter test plan
Next, open your existing JMeter test plan or create a new one according to your testing requirements. Ensure you have included all the necessary elements in your test plan, such as thread groups, samplers, and listeners.
You can configure the test plan to simulate a specific number of users or a particular workload. That allows for a more realistic load distribution, resembling the expected user behavior in a production environment.
Save the test plan if applicable.
Running a distributed JMeter test
Step 1: Start the Slave nodes
On each slave machine, start the RMI registry. Open a command prompt or terminal and navigate to the JMeter installation’s bin folder. Run the following command:
jmeter-server
Alternatively, you can use File Explorer on Windows or Finder on Mac to navigate to the JMeter installation’s bin folder and double-click the jmeter-server.bat file on Windows or jmeter-server Unix executable file on Mac.
Step 2: Start the Master node
On the master machine, initiate the test execution by clicking:
- Run > Remote Start > selecting the corresponding slave IP address
Or by clicking:
- Run > Remote Start All.
That option runs the test plan on all slaves simultaneously.

JMeter will trigger the test execution on the slave machine(s), generating a load based on the defined test plan. Meanwhile, the master machine will collect the test results from the slave(s).
You can monitor the progress of the distributed test execution from the master machine, which provides real-time updates on the status of each slave machine. That allows you to identify any issues or errors during the test execution.
Analyzing JMeter test results
Once the test execution is completed, the master machine consolidates the test results, and the console logs on the slave nodes will resemble the following.
Starting the test on host 192.168.1.21 @ 2023 Jun 3 23:28:55 EDT
Finished the test on host 192.168.1.21 @ 2023 Jun 3 23:37:42 EDT
JMeter provides various listeners and visualization tools to analyze performance metrics and generate comprehensive reports.
Utilize listeners like Aggregate Report or Summary Report to access essential statistics such as response times, throughput, and error rates. These statistics help identify performance bottlenecks, measure the overall system performance, and pinpoint areas that require optimization.
You can identify performance issues by analyzing the test results, such as slow response times or high error rates, and take corrective actions. This iterative testing, analysis, and optimization process ensures that your application can handle the expected workload and provides a smooth user experience.
Final thoughts on distributing JMeter tests
Unlock the full potential of your application’s performance and achieve optimal scalability by harnessing the power of JMeter’s distributed testing. Running JMeter tests in distributed mode offers immense scalability and performance testing benefits. By spreading the workload across multiple machines, you can effectively simulate high loads and ensure your applications can handle heavy traffic. This article outlines that JMeter’s distributed testing capabilities allow you to identify bottlenecks, optimize resource allocation, and build robust and scalable applications.
This post is part of our comprehensive JMeter Mini-Course.
Follow our blog
Be the first to know when we publish new content.