Monitoring and loading tools for testing Apache Tomcat
Archive - Originally posted on "The Horse's Mouth" - 2009-07-07 08:30:43 - Graham EllisThe following monitoring and loading tools can be used to test Apache Tomcat and are all Open Source. This comparative summary includes a link to more details of each of these resources.
ab - ApacheBench. Part of the standard Apache httpd download - a good but basic soak test where you can see how your servers respond to traffic of a particular type from a single source. Good for looking at 'denial of service' type attacks; too basic for typical loading tests.
Example run from command line
ab -n 2000 -c 30 http://192.168.200.215:8080/whm_course/demo.jsp
That's calling for a page to be loaded 2,000 times - with a concurrency of 30 (in other words for there to be 30 connections all at the same time, simulating visits from 30 different places.
jmeter. Open source, part of Apache jakarka. You set up a number (minimum one) of testing machines to generate traffic to the server. You then run a GUI tool on one of the testing machines to gather in the results and process them - into graphic, text report or log forms.
Jmeter allow much more realistic traffic simulation than ab, but is much more complex to set up - people struggle at their first use. We have a sample first demonstration on our web site at:
http://www.wellho.net/mouth/2082_Jmeter-a-first-test-case.html
jconsole. A way of looking inside the jvm and seeing resource use, splitting the heap down to the various generations if need be. Unlike jmeter and ab, this is not a load tester - it adds no load; rather it is a tool for examining a running system.
Example:
http://www.wellho.net/mouth/2080_Using-ApacheBench-and-jconsole-to-test-and-monitor-Tomcat.html
Tomcat Manager. By providing a "manager" role in Tomcat, you can enable the manager, allowing the control of individual web applications (stop, start, etc) rather than having to stop and start all web applications on the same tomcat instance at the same time.
Sample file:
http://www.wellho.net/resources/ex.php4?item=a652/tomcat-users.course.xml
It is also possible to control the logins to the manager using accounts held in databases - there is a sample in the shipped server.xml file.
The Tomcat Manager is listed in this section because it also provides management information with regards to the internal operations of Tomcat and the jvm.