Apache JMeter Distributed Testing sub-steps
This short tutorial explains how to use multiple systems to perform stress tests. Before we begin, there are a few things to check.
- The firewall on the system is turned off or the correct port is opened.
- All clients are on the same subnet.
- If you use 192.xxx or 10.xxx IP address , the server is in the same subnet . If the server does not use a 192.xx or 10.xx IP address, there should be no problem.
- Make sure that the JMeter can access the server.
- make sure to use the same version of JMeter and Java on all systems. Mixed versions will not work correctly.
Once you have determined that the system is ready, you can start the remote test. This tutorial assumes that you have installed JMeter on all systems. JMeter works by a master controller that initiates tests on multiple subordinate systems.
In this tutorial, we only use GUI mode for demonstration purposes. in real life, you should use non-GUI mode to start your load test
A master controls multiple slaves.
1 Terminology
Before we step through the steps, it's a good idea to define some terminology and ensure clarity.
- Main
- Run the JMeter GUI system, which controls the test
- Slave
- Run jmeter-server system that accepts commands from the GUI and sends requests to the target system,
- Goal
- We're going to stress testing the Web server
System category2 minute steps
- on the slave system, go to jmeter/bin directory and execute jmeter-server.bat( on Unix jmeter-server).
- on the main system as the console, open Windows Explorer and go to the jmeter/bin directory
- Open in a text editor jmeter.properties
- Edit Line remote_hosts = 127.0.0.1
- add an IP address. For example, if I have run in 192.168.0.10, ...,192.168.0.15 On the JMeter server , the entry will resemble the following:
Remote_hosts = 192.168.0.10,192.168.0.11,192.168.0.12,192.168.0.13,192.168.0.14
- Start JMeter.
- Open the test plan you want to use
a simple test plan2 start Test
at this point, you are ready to start the load test. If you want to double-check that the slave system is working, open it in your editor Jmeter.log. You should see the following in the log.
Write log files to:/xxxx/xxxxx/bin/jmeter-server.log remote object created: Unicastserverref [liveref:[endpoint:[192.xxx:xxxxx] (local), objid:[- 6A665BEB:15A2C8B9419:-7FFF,3180474504933847586] ]
If you don't see this message, it means The jmeter-server did not start correctly. for tips on debugging problems , go to the Tips section . There are two ways to start a test: a system and all systems.
3 Starting a client
- Click Run at the top
- Select Remote Boot
- Select IP Address
start a Slave4 start all clients
- Click Run at the top
- Select Remote to start all or use Ctrl + Shift + R
start all slaves.5 Limitations
distributed testing has some basic limitations. This is a list of known items, with no specific order.
- RMI cannot communicate across subnets without an agent; therefore JMeter also cannot have no agent.
- starting with version 2.9, JMeter sends all test result split response data to the console, which can reduce the impact on network IO. Ensure that you monitor your network traffic to prevent traffic from causing contention
- A single JMeter client running on the 2-3 GHz CPU (the latest CPU) can process 1000-2000 threads based on the test type.
7 Hints
In some cases, the firewall may still block RMI traffic.
anti-virus and firewallThe antivirus software should be stopped during the load test because it can seriously affect the time it takes to cause incorrect results.
The firewall needs to be stopped from the Windows service or at least some ports need to be opened.
- Open Control Panel
- Open Administrative Tools
- Double-click Service
- Go to Simon Anti-virus, right-click and select Stop
Windows Firewall
- Open Network Connection
- Select Network Connection
- Right-click and select Properties
- Select the Advanced tab
- Uncheck Internet Connection Firewall
of Linux
on Redhat (or derivative products), iptables is turned on by default. Execution
Service Iptables Stop
Stop the Linux firewall or make sure that you open the correct port.
Apache JMeter Distributed Testing