Running distributed JMeter test


For running a significant Load Test (with hundreds or even thousands of concurrents) it might be necessary to utilise capacities of more than one machine. This instruction explains how to run a distributed load test where local machine operates JMeter controlling GUI only and all the load testing is done by remote JMeter servers (kind of slave nodes).

The overall process diagram looks like this:


    1. Download the most recent binary from to all your machines: your client (e.g. your local computer and your servers which will do the load test itself)
    2. cd to jmeter root and run:
  • sudo chmod -R +x bin/

* Note that you need java running on all the machines for JMeter to work. JMeter site also suggests running the same version of Java and JMeter on all the systems. They say that mixing versions may not work correctly.

Variant 1 (via config)

Client configuration

On the client (e.g. controlling jMeter instance on your machine) edit <jmeter root>/bin/ and add:


# should be all localhost records and port should match the one used 

# for “server_port” on remote servers



# if you don‘t specify the port it’s randomly assigned which makes it slightly more 

# difficult to know which port to forward with -R



# Optional change.

# Batch mode returns samples in batches. The default mode is StrippedBatch which 

# returns samples in batch mode (every 100 samples or every minute by default). 

# StrippedBatch also strips response data from SampleResult while Batch doesn’t



# Optional change.

# means every 250 samples or every minute. It is 100 by default

Server configuration

On the server edit bin/ and add:

# Server 1




# Server 2




# Server N



Note, that you only specify exact server_port to be consistent and sure about what to use in SSH tunnel afterwards. If you don’t specify it you’ll have port 1099 by default.

That works fine on remote servers but should be changed for local as you can not specify identical ports for remote_hosts values (e.g. this would be incorrect: remote_hosts=,

Note, that you set server.rmi.localport to some exact value just in order to know it beforehand. jMeter tells you this port number anyway when you start the server:

$ ~/apache-jmeter-2.13# bin/jmeter-server -Djava.rmi.server.hostname=

Created remote object: UnicastServerRef [liveRef: [endpoint:[](local),objID:[…

Note the endpoint:[] which contains the port number.

Starting jMeter instances

# Issue on Server 1

bash bin/jmeter-server -Djava.rmi.server.hostname=


# Issue on Server 2

bash bin/jmeter-server -Djava.rmi.server.hostname=


# Issue on local controlling jMeter server

bash bin/ -Djava.rmi.server.hostname=

# note that can here we start JMeter GUI which is also fine for distributed LT

Launching SSH tunnels

Run locally to create ssh tunnels (different terminals):

# Terminal 1

ssh -vN -L 55501: -L 55511: -R 55512: V338


# Terminal 2

ssh -vN -L 55502: -L 55522: -R 55512: V364


      1. both -L parts are required for remote jMeter servers to operate normally
      2. -R part is only required to get the data back from remote servers (e.g. to see it in local GUI). Without this part LT is still running on server, but there’s no “feedback”

Variant 2 (via CLI params only)

Servers configuration and launch

On all the servers (note, on servers only, not on your controlling JMeter client) cd to jmeter root and run:

$ bin/jmeter-server -Djava.rmi.server.hostname= -Jserver_port=[port1] -Jserver.rmi.localport=[port2]

Note that you can randomly choose ports but be sure they can be used.

E.g. we could issue these commands on servers:

# Server 1

$ bin/jmeter-server -Djava.rmi.server.hostname= -Jserver_port=10101 -Jserver.rmi.localport=10102


# Server 2

$ bin/jmeter-server -Djava.rmi.server.hostname= -Jserver_port=20101 -Jserver.rmi.localport=20102


# Server N (be aware that there’s “N” in port number. Put a number instead)

$ bin/jmeter-server -Djava.rmi.server.hostname= -Jserver_port=N0101 -Jserver.rmi.localport=N0102

Client configuration and launch

Launch your jMeter controlling instance (e.g. on your local computer).


      • make sure you specify all the jmeter servers/ports separated by comma
      • parameter “client.rmi.localport” is a randomly chosen port (possible to be used)

$ bin/ -Djava.rmi.server.hostname= \

    -Jremote_hosts=“[server_port on server #1],[server_port on server #2]” \


In our example (for server #1 and server #2) that would be:

$ bin/ -Djava.rmi.server.hostname= \

    -Jremote_hosts=“,” \


Starting SSH tunnels

Finally, start ssh tunnels with corresponding servers.

For each server issue:

ssh -vN \

    -L [server_port]:[server_port] \

    -L [server.rmi.localport]:[server.rmi.localport] \

    -R [client.rmi.localport]:[client.rmi.localport] \


In our example we’re issuing:

# Terminal 1

ssh -vN -L 10101: -L 10102: -R 10100: V364


# Terminal 2

ssh -vN -L 20101: -L 20102: -R 10100: V338

Start testing

In jMeter GUI click on “Run -> Remote start all” to start testing from remote servers.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s