Master and Slave

The introduction of a Master/slave is archetypal of irregular communication or control where one deice or process controls one or more other devices or processes and serves as their communication hub. In some systems, a master is selected from a group of eligible devices, with the other devices acting in the role of slaves.

Distributed load testing is the process of simulating a very high workload of a massive number of users using numerous systems. As a single system cannot generate many threads (users), multiple systems are used for load testing. It helps to allow the tests and the load.

Apache JMeter, an open-source testing tool, is used for load testing, performance testing, and functional testing. In JMeter, a Master-Slave configuration is used for reaching load testing. Distributed load testing is a bit delicate and can provide inaccurate results if not properly configured.

The distributing testing in JMeter, we refer to a Master-Slave architecture where JMeter uses Java RMI [Remote Method Invocation] to interact with objects in a distributed network. You can see this in the image below.

Pre-Requisites

  • Download and install Apache JMeter from the official Site.
  • Ensure that all the test machines are on the same subnet.
  • Ensure that the same version of Apache JMeter is installed on all the machines.
  • Ensure that the same version of Java is installed on all the machines.
  • Disable firewall or designate it with a proxy supporting RMI protocol.
  • Ensure the correct system configurations such as RAM, processor, and so on.

Use Case

A single Apache JMeter master instance is used to control multiple remote JMeter slave instances and to generate a large volume of load on the test application.

Performing Distributed Load Testing, perform the following:

Start JMeter Server in Master and Slave Systems

To start the jmeter-server.bat in both master and slave systems, perform the following:

  • Click the JMeter home directory --> Bin folder.
  • Run the batch file – jmeter-server.bat (for Windows) or jmeter-server (for Linux)

Set IP Addresses for Slave Systems

To set the IP addresses for slave systems, perform the following:

  • From the master system, open the properties file – jmeter.properties.
  • Remove the current IP for remote_host entry.
  • For example, remove the IP address – 127.0.0.1
  • Specify the IP addresses of all the Remote systems separated by commas.
  • For example, 10.30.11.72, 10.30.1.78 as shown below:
No alt text provided for this image

Start Slave Systems Remotely

To remote start all the slave systems in JMeter, perform the following:

  • Open JMeter in the Master machine (on which properties file are edited).
  • Open your test script and Remote Start all the slave systems.

Starting the Test At this point, you are ready to start load testing. If you want to double-check the slave systems are working, open jmeter.log in notepad. You should see the following in the log. Jmeter.engine.RemoteJMeterEngineImpl: Starting backing engine If you do not see this message, it means the jmeter-server did not start correctly. For tips on debugging the issue, go to the tips section. There are two ways to initiate the test: a single system and all systems.

Start a single client

No alt text provided for this image

1.    Click Run at the top

2.    Select Remote start

3.    Select the IP address

Start all clients

No alt text provided for this image

1. Click Run at the top

2. Select Remote start all or use CRTL-Z

Summary as Distributed testing enables having a local JMeter (master) that grips the test execution, together with multiple remote JMeter instances (slaves) that will send the request to our target server.

Distributed Testing is a kind of testing that uses multiple systems to perform Stress Testing. Distributed testing is applied for testing websites and server applications when they are working with multiple clients simultaneously.

To view or add a comment, sign in

More articles by Maninder Singh Saran

  • JMeter Tool

    Introduction Apache JMeter is Java-based open-source software, firstly developed by Stefano Mazzocchi of the Apache…

Others also viewed

Explore content categories