“It is not the strongest of the species that survive, nor the most intelligent, but the one most responsive to change.” — Charles Darwin

“DevOps is a set of practices that seeks to reduce the gap between software development and software operation.”

JMeter load testing in Amazon AWS EC2

JMeter is popular open source load testing software from Apache.

JMeter is a Java Graphical application. The easiest way to run it in Amazon EC2 is in a windows server so you can easily access it via RDP.

JMeter has a master/slave architecture where the client is the master and multiple JMeter servers are slaves running tests in a scalable fashion. It is best to run both in Amazon EC2, the master on a large instance so it has the CPU to process the graphs and the slaves on medium instances that have the network capacity to run the tests.

1. In Amazon EC2 setup 2 security groups jmeter-master and jmeter-slave with port 3389 open for RDP and set group level access open between them.

2. Pick an Amazon Windows Image. I selected ami-23457f57. At time of writing the latest 64 bit Windows 2008 R2 Server image.

3. Launch a large instance with the jmeter-master security group.

4. Logon via RDP and change the Administrator password and turn off the firewall if Windows 2008 Server.

5. Download Java JDK version 6 or higher and install.

6. Download the binary package of Apache Jmeter and unzip to install.

7. Download the Jmeter Plugins and unzip and copy the JMeterPlugins.jar file to [JMETER_HOME]/lib/ext

8. Edit the jmeter.property file in [JMETER_HOME]/bin folder
   a. uncomment and set
           jmeter.save.saveservice.thread_counts=true
   b. edit the “remote_hosts” property and set to
          slave1:1099,slave2:1099,slave3:1099,slave4:1099

9. Edit the C:\Windows\System32\drivers\etc\hosts and add
127.0.0.1 slave1
127.0.0.1 slave2
127.0.0.1 slave3
127.0.0.1 slave4

10. Add a shortcut on the desktop. Before we run we update with the ip addresses of the slave servers.

11. Start JMeter by running [JMETER_HOME]/bin/jmeter.bat and create a test script. There are many tutorials on JMeter,  for example http://jmeter.apache.org/usermanual/build-web-test-plan.html.  Also use the JMeter plugins to provide extra graphs.      
 
12. Create an image of the server.

13. Start up a slave machine by running an instance using the image built and use the security group jmeter-slave.

14. update the hosts file on the jmeter-master server with the private IP address of the slave.

15. Logon to the slave machine via RDP and run  [JMETER_HOME]/bin/jmeter-server.bat

16. On the jmeter-master server in JMeter select run -> remote start -> slave1 to start the test you should seem a message about starting the test.

17. Enjoy the graphs....change the tasks....add extra slaves......

References

JMeter remote testing on aws ec2
JMeter distributed testing with amazonec2
JMeter Plugins
JMeter Distributed Testing Step-by-step

3 comments:

Barry Jones said...

Interesting tool. Have you thought about duplicating traffic to your test servers with Parallel Proxy? (http://www.parallelproxy.com)

Anonymous said...

It's quite interesting. Also there such cloud service which offers Jmeter cloud testing. Have you tried?

Anonymous said...

Or you can use https://loadfocus.com to run distributed JMeter test from your cloud account, it's very easy and everything is live.

Post a Comment