giovedì 24 luglio 2008

tomcat or httpd?

java is slow, c++ is fast.
Tomcat is slow, httpd is fast.
Right?
Probably not.


First off, I'm bias in favor of Tomcat. Based on these results, I can state with confidence Tomcat 5.5.4 has made great strides since Tomcat 3.3. Tomcat 5.5.4 is faster, more reliable and more efficient than previous releases. For those who wonder “can tomcat handle static files?” My opinion is yes. If you only have a single server co-located at an ISP and can't afford a dedicated image server, Tomcat will work just fine. For sites that need high performance/high availability, the
best option is to setup dedicated Apache2 for the static files. This setup allows tomcat to focus on generating dynamic content, instead of clogging the network IO. Hopefully these results help dispell the myth that Tomcat 5.5.4 can't handle static files efficiently.

tomcat benchmark summary.

Running the test on a quiet network five times, with the ab commands running in a different order to balance out any caching issues, I got the following:

Direct access via httpd - 300 per second
Direct access via Tomcat - 483 per second
Access via both servers connected by jk - 307 per second
Access via both servers connected by proxy - 222 per second

www.wellho.net

Apache httpd is really only appropriate with odd configurations
including load balancing, multiple apps in separate JVMs, other needs
(such as PHP support, or some module only available in Apache), or when
Apache httpd is already present and nobody wants to get rid of it.

Christopher Schultz

see also Tomcat: the definitive guide.