JMeter Master Slave Setup In Multiple AWS Regions
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:
Master server:
IP: 52.88.159.81
Region: Oregon
Slave server:
IP: 52.71.163.50
Region: N.Virginia
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=52.71.163.50
[/js]
2. Then run the load test from master after invoking it on its public IP:
[js]jmeter -n -t load-test.jmx -R 52.71.163.50 -Djava.rmi.server.hostname=52.88.159.81
[/js]
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.
What about the port communication? If you are running the test in EC2 don’t we need to open the required ports in the security group?
Obviously, that communication has to be in place.
Well the port communication is not that obvious to set up and rather key information missing from the above blog. Which is where I am currently struggling. But overall very helpful blog to give me a head start. Thanks for sharing.