Tuesday, January 31, 2012

JMeter quick start guide (part 1)

Everyone seems to love JMeter, but I found the learning curve quite steep. It seems to be a blank palette with lots of "this is how this works" kind of verbiage but not a whole lot of "this is how you use this tool." So with that, here's a howto I wrote for my company. Any confidential info will be replaced with XXXXXXX.

Let me STRESS that this is how I did it but may or may not be how most people do it or at all the best way to do it. I am completely open to suggestion and constructive criticism because I felt like I did this from scratch. I will post these in 4 parts as I did on my company's wiki.

--------------------
0. Overview
--------------------

Overview:

JMeter is a load test suite (unfortunately) written in java. We use it to gather performance data based on realistic loads of various types (reporting, ordering, data format translation, DWR, admin functions, etc.) by various user types. The basic gist is that you

  1. record a series of http requests into a .jmx file
  2. replace the hardcoded values (server names, user names, etc.) with variables such as ${INST_USER_01}
  3. create input .csv files with values for those variables
  4. feed the .csv and .jmx files to jmeter to run the load

The tester should watch the app's log and check that (for example) the reports have been run to make sure the requests are running correctly. If the app changes significantly, the tests may need to be re-recorded. Hopefully this will be rare.

JMeter is highly configurable and has a steep learning curve. The user manual (http://jakarta.apache.org/jmeter/usermanual/index.html) is quite good but I'll try to write the steps in a series of child pages.

Notes:

Be careful of /tmp filling up on the app server.



--------------------
1. Setting up JMeter
--------------------

more likely than not, you'll be using our JMeter box to run tests, but you'll need it on your local machine to develop:

  1. download JMeter
    1. our copy (version 2.3.4):
    2. online: http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi
  2. to install, just unzip into a folder on your machine
  3. create our folders
    1. jakarta-jmeter-2.3.4/data
      1. where the .jmx test files will go
    2. jakarta-jmeter-2.3.4/data/input
      1. where the .csv (user and hostname variables), .zip (bulk upload) files will go
    3. jakarta-jmeter-2.3.4/data/output
      1. output log and .csv
    4. jakarta-jmeter-2.3.4/data/old
      1. a place to put old output
  4. config files
    1. bin/jmeter.bat
      1. I set the Heap as high as it would go on my local machine (think this is my only customization):
      2. set HEAP=-Xms512m -Xmx1400m

No comments:

Post a Comment