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
#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.
#don?t use the console.
#The directory which logs the results, and the number of old results to keep.
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)
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
Subscribe and Share!Did you enjoy this article? Your feedback is very important! I'd like to invite you to keep up to date with the latest posts from Anticlue. We offer several venues. If you have some questions, help can be found here.
- Become a Facebook Fan
- Subscribe to Anticlue
- Follow me on Twitter
- Add to Technorati Favorites
- Digg this post