Friday, June 14, 2013

User Load Testing Simulation - Installing Apache JMeter on Windows 2012 Base

Apache JMeter is good for load testing web applications. Our goal of this post is to install JMeter on a EC2 instance.  The reason why we are using Windows is that JMeter has a GUI. It is less work to use it on Windows than Ubuntu.

Specs:

  • Windows 2012 Base
  • m1.large EC2 instance
  • Java Open JDK 1.7

Make a security group called JMeter.  Open the following ports

  • port 3389 for RDP for 0.0.0.0\0
  • all ports for ICMP for the JMeter Group
  • all ports for the JMeter Group

First spin a Windows 2012 Base instance. Use m1.large. Choose a region that your web application machines are located.  Attach to the JMeter security group. Label the instance JMeter Master.

The machine will be generating a password. You will need to wait a bit before you can RDP into the machine.

Once you RDP into the machine, lower the Internet security so you can use the browser.

Go to control panel and turn off all the firewalls. We will

Download the latest JDK. Follow the install wizard.

Download Apache JMeter, and unzip it to a folder (ex. C:\tools\apache-jmeter-2.9).

Download the JMeter Plugins.

Unzip the JMeter Plugins and put the JMeterPlugins.jar into the JMETER_INSTALL_DIRECTORY\lib\ext directory.

Change the following properties in bin\jmeter.properties.
jmeter.save.saveservice.thread_counts=true
If you want to use more than one machine to generate load testing requests, you can change the remote hosts attribute in jmeter.properties and declare the hosts in hosts files. We will set up extract two machines: slave1, slave2

Change the remote_hosts property from
remote_hosts=127.0.0.1
to
remote_hosts=slave1:1099,slave2:1099
Edit C:\Windows\System32\drivers\etc\hosts
127.0.0.1 slave1
127.0.0.1 slave2
Create a test plan.

Create a AMI in the EC2 console.

Start an instance using this AMI. Label this the JMeter Slave.

Try to ping each other and make sure the JMeter Master and Slave can connect to each other. If not, remember to open ICMP in your security group.

Log into the JMeter Slave. Start jmeter-server.bat in the bin folder.

Log into the JMeter Master.

In the hosts file, change slave 1's IP to that of the JMeter Slave.

Start JMeter. Open your test plan. Run -> Remote Start -> slave 1:1009.

You should be able to see the test results.




1 comment:

  1. Hi Kenneth,
    I was searching for JMeter experts on Google, and stumbled across this post. Running JMeter on EC2s is a subject I take very personally :) I have an opportunity that you might be a good fit for, but I couldn't find your contact info on this blog. Let me know if you are interested by emailing paul@blazemeter.com

    ReplyDelete