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
(path to /robots.txt)
5. I added a GRAPH RESULTS
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, updated 2012-10-13)
Associated topics are indexed underA506 - Web Application Deployment - Java - Installing and Deploying optional Technologies 
Gathering information - logging - with log4j. First steps. - (2010-11-12) 
Connecting jconsole remotely - the principles - (2009-03-14) 
Java - Memory Allocation and garbage collection - (2009-03-14) 
Increasing Java Virtual Machine memory for Tomcat - (2008-07-24)A912 - Web Application Deployment - Upgrading and tuning Tomcat 
Tuning Apache httpd and Tomcat to work well together - (2010-10-27) 
Database connection Pooling, SSL, and command line deployment - httpd and Tomcat - (2009-03-01) 
Java CLASSPATH explained - (2008-11-26) 
Load Balancing with Apache mod_jk (httpd/Tomcat) - (2007-10-02)A692 - Web Application Deployment - Monitoring and load testing your server 
Server logs - drawing a graph of gathered data - (2010-11-03) 
Apache httpd Server Status - monitoring your server - (2010-10-28) 
Logging the performance of the Apache httpd web server - (2010-10-25) 
Monitoring and loading tools for testing Apache Tomcat - (2009-07-07) 
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