Friday 30 March 2012

How to use JMeter for Distributed Testing


In order to run JMeter in distributed environment for stress testing you must setup your all host (slave) machines with the same configuration which you currently have for your master machine.

Here are steps which you need to follow to setup Master machine:
  1. Install the latest JDK on your Master machine.
  2. Install the latest JMeter on your Master machine.
  3. Navigates to “C:\JMeter\apache-jmeter-2.6\bin\jmeter.properties” file.
  4. Find (remote_hosts=127.0.0.1) replace 127.0.0.1 with you host (slave) IP address
     Example: remote_hosts=192.168.16.239,192.168.16.107,192.168.16.24

     5.  Save and close the jmeter.properties file.


Follow the steps to setup you host (slave) machine:
  1. Install the latest JDK on your host (slave) machine.
  2. Install the latest JMeter on your host (slave) machine.
  3. On the slave systems, go to jmeter/bin directory and execute jmeter-server.bat (jmeterserveron unix). On windows, you should see a dos window appear with “jre\[version] \bin\rmiregistry.exe”. If this doesn't happen, it means either the environment settings are not right, or there are multiple JRE installed on the system. Note: [version] would be the jre version installed on the system. Screenshot is attached below for the reference.

Follow the steps to start the test on the Master Machine:
  1. Open JMeter on your Master Machine.
  2. Open your test plan.
  3. Click Run at the top.
  4. Select Remote start à (Now you should be able to see your host machines)
  5. Select the IP address to run your test from your selected host machine.
          Screenshot is attached below


Or

6.   If you want to run your test from all your test machine then select “Remote Start All”.

Troubleshooting:

If you are unable to run test form the above machine and see below error (screenshot is attached) just ask owner of host machine to run the jmeter-server.bat file.


 Tips:

In some cases, the firewall may still be blocking RMI traffic.

Symantec Anti-Virus and Firewall

In some cases, Symantec firewall needs to be stopped from windows services.
  1. Open control panel
  2. Open administrative tools
  3. Double click services
  4. Go to down to symantec anti virus, right click and select stop.
Windows firewall
  1. Open network connections
  2. Select the network connection
  3. Right click and select properties
  4. Select advanced tab
  5. Uncheck internet connection firewall
Linux
  1. On Suse linux, ipchains is turned on by default. For instructions, please refer to the “remote testing” in the user manual.
Listener

Use “Aggregated Report” listener to see the aggregated report from your all host machine.


Limitations:

There are some basic limitations for distributed testing. Here's the list of the known items in no specific order.
  1. RMI cannot communicate across subnets without a proxy; therefore neither can JMeter without a proxy.
  2. Since JMeter sends all the test results to the controlling console, it is easy to saturate the network IO. It is a good idea to use the simple data writer to save the results and view the file later with one of the graph listeners.
  3. Unless the server is a large multi-processor system, in most cases 1-2 clients is sufficient to overwhelm the server.
  4. A single JMeter client running on a 1.4-3 GHz CPU can handle 100-300 threads depending on the type of test. The exception to the is web services. XML processing is CPU intensive and will rapidly consume all the CPU cycles. As a general rule, the performance of XML centric applications will perform 4-10 slower than applications using binary protocols.
       References:

               1.   http://jmeter.apache.org/usermanual/