automatictester

my thoughts on test automation

Distributed testing with JMeter

Once you move on from prototyping your performance tests to actual performance test execution, single JMeter instance may quickly become the bottleneck. In this tutorial I’ll show you how to configure distributed testing.

Infrastructure:

  • 192.168.56.1 – JMeter client (machine which controls test execution)
  • 192.168.56.101 – JMeter server I (machine which executes tests and send results back to the client)
  • 192.168.56.102 – JMeter server II (same as above)

All above machines are dual-homed: have 2 network interfaces. Once is used for accessing internet, another for communication between the nodes. In this scenario we don’t make use of VPN, proxy and don’t need to set up SSH port forwarding.

Client configuration

In jmeter.properties, set the following:

remote_hosts=192.168.56.101,192.168.56.102
client.rmi.localport=1234

Server configuration

In jmeter.properties, set the following:

client.rmi.localport=1234
server.rmi.localport=54321

In jmeter-server, set the following:

RMI_HOST_DEF=-Djava.rmi.server.hostname=192.168.56.101

Do the same for 2nd server, but specify 192.168.56.102 IP address. You may want to use different port numbers. As long as ports you pick are not in use and client-side configuration matches server-side configuration, this is fine.

Test Execution

Start JMeter server on both nodes by running ./jmeter-server.

In the above steps, you configured bi-directional communication between client and servers. Once this is done, you are ready do kick off test execution with Run / Remote Start All in JMeter GUI. Alternatively, you can run your tests in non-GUI mode.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: