JMeter - How to perform Distributed Load Testing?

JMeter - How to perform Distributed Load Testing?

2017 / 12 / 10

Load Testing, JMeter, Performance testing, Best Practices, Distributed testing

As JMeter has some limitations for generating requests from one single machine, we go for distributed testing to overcome it. In distributed testing we configure a Master machine and certain number of slave machines (and the no of slaves depends upon the load/users) to simulate load with more numbers of users. The master machine controls the test and slaves do the actual job.

distributed load testing

Let's consider 4 machines which are setup on cloud with 8GB RAM configuration. One will be termed as Master and other 3 will act as slave machines.

    Now, steps to be done before starting the distributed testing through GUI:

  • Ensure that the 'system firewall' is turned off
  • Download latest and same version of Apache JMeter along with the supported version of Java.
  • Now open the jmeter.properties file of the master machine, and add remote_hosts=192.168.10.01,54.153.130.212,54.215.185.156 (IPs of slave machines) under Remote hosts and RMI configuration.
    distributed load testing configuration
  • Though there is no need to start RMI registry separately, but if you want to run the JMeter on specific port, you can define in jmeter. properties with following command: - server.rmi.localport=4000 (define the port)
  • Now open jmeter-server.bat file in all the slave machines.
    distributed load testing server bat file
  • In master machine, just open JMeter (jmeter.bat) in GUI and select the test plan which you want to run and click Run in the we can see 'Remote Start' (or) 'Remote Start All' (we can see the IP of three slaves which we given in jmeter.properties file).
    distributed load testing remote start
  • By selecting Remote Start All, all the slave systems will get started. We can see in jmeter-server.bat file of slave machines.
    distributed load testing starting test on host
  • We will get the test results in Master-JMeter GUI itself.

To run the test through command line (NON-GUI MODE):

  1. After setting up JMeter and turning off the system firewall.
  2. In slave machine go to CL (Command Line) and set the path to JMeter-bin and give the following command:
    - jmeter-server.bat -Djava.rmi.server.hostname=54.215.185.156 (ip of slave machine) say enter we can see the end point to 54.215.185.156.
    distributed load testing jmeter path setting
  3. Now in Master machine open CL and set the path to JMeter-bin and pass the following command:
    - jmeter.bat -n -t nameofjmx.jmx -l sample.jtl -R 192.168.10.01,192.168.10.02,192.168.10.03 (Slave machine ips).
  4. You can find the remote engines have been started in Master.
    distributed load testing configuring remote engine
  5. After the completion of test take the jtl file and browse it in JMeter GUI to get Aggregate Report or any other Graphs.

To know more about apache JMeter, read here.

You might also like