Let’s perform distributed load testing using JMeter
Running Jmeter in our local machine has some limitations
The number of concurrent threads which can be created depends on the CPU and memory available in the local machine
To avoid this limitation, you can run your load test using the Master-Slave architecture in Jmeter. It uses Remote Method Invocation available in Java to support this distributed network option
In this scenario, a local Jmeter(Master) will start test execution by spinning up remote Jmeter instances and it sends requests to the target end server.
To start with this configuration, we need to have multiple computers
All the master and slave machines need to locate in the same subnet
These are the steps we need to follow
01. First, we need to get a running Jmeter server in each slave machine. To do so we need to run the JMeter-server.bat which locates in the Jmeter/bin
02. In the Master machine locate the Jmeter.properties file and edit it remote_hosts property adding all the IP addresses of slave machines. Use commas to separate IP addresses from each other
03. Thread group in the master instance, you can configure the users, ramp up and iteration information in the Thread Properties section
If you are running this in GUI mode in the master instance you can run it using two options
Option 01
Run the selected remote server
Option 02
Run all the remote servers at once
In distributed test run it is highly recommended to use the non-GUI mood. You can use the following options to run Jmeter in non-GUI mood
· jmeter -n -t script.jmx -r
· jmeter -n -t script.jmx -R server1,server2,…
Flags used in the above commands are used following purposes
· n to start Jmeter in a non-gui mode
· t to define the test file
· r to start the remote server as defined in the JMeter properties file
· R to define the list of servers and start them
Now each slave JMeter instance executes the load test runs according to the configuration set in the master. For example, if we are having 10 slave Jmtere instances and in our master instance, we configure to run 100 concurrent users in the test plan. Target endpoint gets 1000 user load through the load test
100*10 = 1000
That’s it, now you can run your Jmeter scripts to a higher concurrent user count without limitations