In this blog, I’ll be demonstrating how to set up master-slave JMeter set up in multiple AWS regions. The aim is to generate load from multiple regions or multiple AZs in order to get a flavour of real load. For this purpose I am using EC2 servers, so a master server in Oregon region and the slave is running in N.Virginia region.
Image Source: http://gerardnico.com/wiki/jmeter/remote
Here are the details:
I am using the same version of JMeter on both the servers. By default, the JMeter invocation works on the instance’s private IP that is why the master-slave instances are able to communicate with each other if they are in the same VPC, but when we span the set up to multiple VPCs or even regions then the same thing with private IP doesn’t work. For this purpose, we have to invoke the JMeter daemons on their public IP so that they can communicate with each other on their public IP.
For this purpose, we have to make some changes in the configuration. To invoke jmeter daemon over its public IP, we have to set a parameter “-Djava.rmi.server.hostname=” on the command on both the master and slave servers.
So the steps are listed below:
1. First, we have to trigger the JMeter daemon of the slave server on its public IP:
[js]sudo /usr/share/jmeter/bin/jmeter-server -Djava.rmi.server.hostname=126.96.36.199
2. Then run the load test from master after invoking it on its public IP:
[js]jmeter -n -t load-test.jmx -R 188.8.131.52 -Djava.rmi.server.hostname=184.108.40.206
On Slave’s side:
After following these steps, you should be able to run the master slave load test setup in multiple regions.
To know more about the best practices of Load testing, click here.