December 12, 2004
The Grinder 3 & Web Application load testing
Web Applications have a wide range of user populations. It is not uncommon to have tens of thousand of visitors hit a site during a week. One really needs to know if the application can perform under a load and what level of load. This type of testing is know as load testing. There are several load testing tools available. The industry standard tool is Mercury Interactive?s Load Runner. I?ve seen it, and I?d recommend it. Unfortunately, I haven?t had the chance to use it, but I?ll recommend the business case again next year. In the meantime, one tool that I recently tried out with CFMX is The Grinder.
The grinder is an open source load testing framework. I went very out of character and utilized the Beta version, grinder 3, because it uses Jython to write scripts. With the grinder 3, you can load test anything; databases, messaging services, web apps, web services, etc. I?m hoping to utilize the grinder 3 to load test Quovadx/Cloverleaf Interface Engine, the Siemens Soarian Clinical Access, Crystal Enterprise 10, 3M?s Encoder, and several other applications.
Installing the Grinder 3
1. First ensure java is installed on the machine where you will be running the scripts. If not, please download from here.
2. Download and unzip the grinder 3 from here.
3. Download the jython2.1 class file.
4. Add the grinder.jar to your CLASSPATH variable.
- Set CLASSPATH=%CLASSPATH%;c:\grinder-3.0-beta23\lib\grinder.jar
5. Install the jython2.1 class file.
- Java jython2-1
Aside: Remember the directory and set it in the grinder.properties file
To get into the Grinder console, run java net.grinder.Console. You can find more about the console here. I'm not very big on the GUI, but it does its job.
Recording Web App test scripts
Hand coding the test scripts would get to be very trying in a very short time. In order to maintain one?s sanity, exploit the TCPProxy httpplugin to record scripts.
1. First, set up IE to temporarily use a proxy server.
- Menu -> Tools -> Internet Options -> Connections tab
- Click on Lan Settings button
- Check the use a proxy server for your lan setting
- Click on Advanced button
- Set the http proxy address to use to be localhost, port 8001
- Set the secure proxy address to use to be localhost, port 8001

2. Fire off the TCPProxy within grinder.
- java net.grinder.TCPProxy ?console ?httpplugin

3. Surf away with the IE session, and you will have all actions recorded.
4. Click Stop Recording on the TCPProxy Window, when you are done.
5. Remove the changes to the IE Browser, unchecking using a proxy server.
6. You will notice within the directory there is a httpscript.py and a httpscript_tests.py file. These are your test scripts.
A quick aside point is that if you don?t want to switch setting, one could always leave ie in the record mode and surf the web with firefox.
Running the test scripts
A key thing to remember when you are running your test scripts, set up multiple grinder sessions on multiple machines. This way everyone isn?t using the same network interface.
1. Set up resource monitoring with performance monitor on the server, and client machine.
2. To run the grinder test scripts;
- In the same directory have a grinder.properties, this file contains the configuration settings
- Also within that directory, have the script you would like to run. For our example, find the httpscript.py and httpscript_tests.py files.
- run java net.grinder.Grinder, from that directory.
The settings in the grinder.properties file are:
#
# Example grinder.properties
#
# Set the jython class directory
grinder.jvm.arguments=-Dpython.home=c:\jython-2.1
#Set the worker processes, with threads, and runs.
#So for this example, I have 10 worker processes with 20 threads each.
#They will cycle 100 times.
grinder.processes=5
grinder.threads=3
grinder.runs=100
#don?t use the console.
grinder.useConsole=false
#The directory which logs the results, and the number of old results to keep.
grinder.logDirectory=log
grinder.numberOfOldLogs=2
#grinder.initialSleepTime=500
#grinder.sleepTimeFactor=0.01
#grinder.sleepTimeVariation=0.005
grinder.script=httpscript.py
I?m hoping grinder is going to be an easy to setup load testing in a systematic way. Our first shot out of the door will be Crystal Enterprise 10 this week. (stay tuned)
Places that helped
WebSite:
The grinder 3 manual
Dan Moore?s the grinder
Open Testing Reviews The Grinder
The HTTPClient Info
The grinder loadtesting for everyone
NewGroups
grinder-announce: Low-volume notifications of new releases
grinder-use: The place to ask for help
grinder-development: For those interested in developing The Grinder
important typo:
java net.grinder.TCPProxy –console –httpplugin
does not work, use
java net.grinder.TCPProxy -console -httpPlugin
Hello Elyse, When I get a chance I will try Grinder. How many virtual users are you given with the beta version??
Posted by: Jim Kipp at September 9, 2005 8:21 AMThank you very much for posting the above information. It surely saved me a lot of time and effort.
Posted by: Alex at May 10, 2007 3:01 PMWe got information about this tool by my friends, lets check it & reply
Posted by: Nirmal Kumar at May 21, 2007 6:42 AMFinally passed the test
Managing in light of McGregor's Theory X and Theory Y
CMMI
Kicking HIT Leadership Up a Notch
That's just some mumbo jumbo project management BS
Outcomes - The tactic to get to the strategy
Nurse Call, VOIP, and Wi-Fi: Its just cool when things come together!
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
August 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
November 2005
October 2005
September 2005
August 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
Joel on Software
David Ross
Edward Prevost
Martin Fowler
The Health Care Blog
The Tales of Hoffman
The Business Word
Medical Rants
Christina's Considerations
Paul Levy
HIS Talk
Appropriate IT
Candid CIO
RSS feed




