TestingTo testI recommend the ApacheBench (ab) program that is included with all recent versions of Apache. To test, try:
ab -k -n 10000 -c 10 http://localhost:8080/index.html
or for bandwidth testing:
ab -k -n 10000 -c 10 http://localhost:8080/medium.bin
Note that as the tests are on static files the system can saturate most network connections. I had to test on the local loopback which severely influences the results. Example resultsUsing ab Version 2.0.40-dev on my iBook/800MHz with a pre-release of the jdk (build 1.4.1-beta-20) the basic results for the bandwidth test is:
Time per request: 1.102 [ms] (mean, across all concurrent requests)
Transfer rate: 29127.05 [Kbytes/sec] received
The output of
Processes: 63 total, 3 running, 60 sleeping... 147 threads
CPU usage: 35.0% user, 65.0% sys, 0.0% idle
PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE
6681 java 48.0% 0:35.72 9 236 109 26.7M 712K 14.7M
6696 ab 29.4% 0:12.90 1 11 28 1.58M+ 612K 2.00M+
0 kernel_tas 13.4% 15:23.10 27 0 - - - 33.4M+
Perfcap results
Perfcap
The row index is the number of concurrent connections. The Tomcat 3.3.1 test is unfair as ApacheBench and Tomcat don't support the same type of keepalive connections. Transfer rate (kb/s)Higher numbers are better
Requests per secondHigher numbers are better
Time per request (ms)Lower numbers are better
|