Would you like to see how your web site performs under load? I mentioned ApacheBench (ab) in a recent post, but you can also use a tool like Jmeter. And although Jmeter is written in and runs in Java, you can use it to look at the performance of other servers and network resources too.
In famous
"Blue Peter" jargon, 'here is one I put in the oven earlier' ...

... and the reason I put one in the oven earlier is because like all things Java, the documentation and setup looks very complicated at first.
How did I set this up?
0. I fired up Jmeter - previously downloaded and unpacked - making sure that a Sun JRE was 'top dog' in my PATH.
1. I started a new
TEST PLAN
2. I added a
THREAD GROUP
(4 users, 4 seconds ramp up, 200 loops)
3. I added an
HTTP REQUESTS DEFAULT within
Config Element
(wellho.net as the server but
please use your own if you're following this!)
4. I added an
HTTP REQUEST within
Samplers
(path to /robots.txt)
5. I added a
GRAPH RESULTS under
listener
6. I saved the configuration as a .jmx file (robots.jmx)
and I chose "run" ...
Let me fill you in on those results. There were 800 samples taken as I asked for 200 sets of 4 samples, and I spread the sample sets out over 4 seconds apiece, so the total run time was about 3 minutes.
The sprinkling of black dots represent the individual samples and how long each of them took, with the blue line showing the average time and the purple line showing the median (time of the 50 percentile sample, which is a little bit different). The red and green lines are on different scales - the red line showing the deviation or variance which was high at first (probably because the first few samples would have been slow, the later samples consistently faster) and the green lines shows the throughput achieved - that starts low and rises, again because of early slow samples.
Right. Here is a stern lesson. Do NOT run Jmeter against a server that you don't own / don't have permission to try it out on. Tests like the one I have done above are cruel and can bring a server to its knees very quickly, so using Jmeter is a way to make yourself very unpopular! BUT if you're configuring a new environment it's a great tool!
I have only started to scratch the surface here ... as you put your first test plan together, follow what I have done
on your own server .... and as you put your second plan together, have a look at the manual that covers it from Apache - in particular chapter 5 -
here. You'll find it's very clever in terms of logging in, posted data, handling cookies and doing a lot more to simulate real traffic. Proceed further and you'll find that you can combine thread groups that are being run by different instances of Jmeter into a single report, and get some very sophisticated load testing running.
(written 2009-03-14 17:54:41)
Associated topics are indexed under
A506 - Web Application Deployment - Java - Installing and Deploying optional Technologies [2081] Connecting jconsole remotely - the principles - (2009-03-14)
[2079] Java - Memory Allocation and garbage collection - (2009-03-14)
[1718] Increasing Java Virtual Machine memory for Tomcat - (2008-07-24)
A912 - Web Application Deployment - Upgrading and tuning Tomcat [2060] Database connection Pooling, SSL, and command line deployment - httpd and Tomcat - (2009-03-01)
[1908] Java CLASSPATH explained - (2008-11-26)
[1377] Load Balancing with Apache mod_jk (httpd/Tomcat) - (2007-10-02)
A692 - Web Application Deployment - Monitoring and load testing your server [2272] Monitoring and loading tools for testing Apache Tomcat - (2009-07-07)
[2080] Using ApacheBench and jconsole to test and monitor Tomcat - (2009-03-14)
Some other Articles
C Programming v Learning to Program in C. Which course?MySQL - licensing issues, even with using the nameBooks and distance learning from Well House Consultants?Do you support a decent train service? Please sign up!Jmeter - a first test caseA lot has changed - but the memory lingers onWhy put Apache httpd in front of Apache Tomcat