Controlling Jmeter Slaves on EC2 from your Local Machine

Overview

Distributed Jmeter on AWS EC2, controlled from Local Machine

Why not ECS?

Settings

Slave onfigurations

  1. “client.rmi.localport” to something that’s free to use
  2. “server.rmi.localport” also to something that’s free to use
  3. “server.rmi.ssl.disable” to false IF you don’t want to use SSL for the connection between the slaves and controller
  4. “-Djava.rmi.server.hostname=” when starting jmeter-server (your slave). But this is taken care by the script.

Controller Configuration

  1. All the public DNSes need to be included in your controllers’s jmeter.properties. The property you need to put in is “remote_hosts”. Multiple hosts can be separated by comma ‘,’.
  2. Then, append “-Djava.rmi.server.hostname=” parameter when running jmeter with the value of your machine’s public IP. You can google something along the lines of “my public ip”.

Port Forward / Adding in DMZ

Security Policy on EC2

Le Simple Script

PUBLIC_DNS=$(ec2metadata --public-hostname)(exec bin/jmeter-server -Djava.rmi.server.hostname=$PUBLIC_DNS)

Scaling Up

  1. Launch another instance from template
  2. Run the jmeter slave via configured script above (or if you make it into service and run on startup, you can skip this step)
  3. Add the public DNS on your Jmeter controller.
  4. Start Jmeter on your local machine.
  5. Test away.

Conclusion (The Steps, Concisely)

  1. Ensure that the jmeter slave hosts IP is the public DNS of the EC2 instance.
  2. Ensure EC2 instance policy is correctly set (which port to open) and reachable from outside
  3. Ensure that the IP of the controller is the public IP of your machine (you can google my IP). Assign by your ISP.
  4. Ensure your controller machine is port forwarded or put in DMZ (riskier but convinient)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store