Search code examples
amazon-web-servicesjmeterdistributed-testing

Jmeter distributed testing on AWS EC2 slaves


i want to configure a distributed testing system to handle big load on my app. i followed the Jmeter manual but still having issues. first, the slaves and the master are remote EC2 machines on AWS(same region, but different availability zones). i disabled the rmi ssl with this command server.rmi.ssl.disable=true in .properties file on both master and slave, configured the remote_hosts var as well with the slave IP on the master. before starting remote execution i lunched the jmeter-server.bat on the slave.

i tried to run a test with simple http request to the slave and got:

Connection refused to host: IP;nested exception is:
java.net.ConnectException:connection refused:connect

i disabled the firewall in both slave and master, Jmeter and java versions are the same.

i figured out that the server port is dynamic, so i can not save the .properties file on the master before server is running and the port is known. is there any way to bind the port number of the server to use the number i specify? and if so what should i change and in which file.


Solution

    1. Make sure to use public IP addresses (you can use private ones as well, but the machines have to be inside the same VPC)
    2. Disabling firewall is not enough, you need to whitelist the ports using Security Groups
    3. The ports used for JMeter master/slave RMI communication can be defined using the following JMeter properties

      • server_port
      • server.rmi.localport
      • client.rmi.localport

    You can find a wrapper script like JMeter ec2 Script easier to use