Thursday September 15, 2005
Jetty vs. Tomcat vs. Resin: A Performance Comparison This morning, I did some comparisons between Jetty 5.1.5rc1, Tomcat 5.5.9 and Resin 3.0.14 (OS version). I ran AppFuse's "test-canoo" target, which tests all the JSPs using Canoo WebTest. I did this as a Servlet 2.4 application, and had to tweak some stuff in my web.xml to make it work on Jetty and Resin. Nothing big, just stuff that Tomcat let pass through and these servers didn't. One interesting thing to note that Resin requires you to use "http://java.sun.com/jstl/fmt" for JSTL's "fmt" tag URI, while Jetty and Tomcat require "http://java.sun.com/jstl/fmt_rt". This is with Resin's "fast-jstl" turned off - b/c everything blows up if it's turned on (I don't feel like coding my JSTL to Resin's standards, that's why I turn it off).
Below is a list of the average time it took to run "test-canoo" after I ran it once to compile all the JSPs.
- Jetty: 19 seconds
- Tomcat: 19 seconds
- Resin: 29 seconds
In addition, I tested how long it took for each server to startup - including the initialization of AppFuse.
- Jetty: 7 seconds
- Tomcat: 8 seconds
- Resin: 13 seconds
So what does all this mean? A number of things:
- I need to clean up AppFuse's web.xml a bit for 2.4 applications.
- Putting the database connection pool configuration in a Spring context file (vs. JNDI) makes AppFuse much more portable.
- Jetty isn't as fast as Jetty-lovers say it is (or maybe Tomcat just caught up).
- The open source version of Resin is much slower than the other open source servlet containers.
- I should restructure the build.xml to pull out Tomcat stuff and allow users to specify server deployment settings (i.e. in a ${servername}.xml file).
- Orion still doesn't support the Servlet 2.4 or JSP 2.0 specifications.
Posted in Java at Sep 15 2005, 10:52:50 AM MDT 12 Comments
Search This Site
Recent Entries
- My TSSJS 2010 Presentations and Summary
- What's New in Spring 3.0
- Developing Rich Web Service APIs with Java
- C++, Java and .NET: Lessons Learned from the Internet Age
- Highly Interactive Software with Java and Flex
- The Cloud Computing Continuum with Bob McWhirter
- Software Quality: The Quest for the Holy Grail?
- What's Happening in the Java World?
- Fantastic Fun in Jackson Hole
- How We Hired a Team of 10 in 2 Months
Posted by Andy Hoffman on September 15, 2005 at 11:39 AM MDT #
FWIW, this isn't the first time I've done such a comparison.
Posted by Matt Raible on September 15, 2005 at 11:47 AM MDT #
Posted by Stephen Duncan Jr on September 15, 2005 at 12:20 PM MDT #
Posted by Matt Raible on September 15, 2005 at 12:22 PM MDT #
Posted by Stephen Duncan Jr on September 15, 2005 at 12:30 PM MDT #
Posted by Stephen Duncan Jr on September 15, 2005 at 12:31 PM MDT #
thanks for sharing this. I was about to do this shortly -- saved me some good time.
RESIN : Although, wondering if this has to do with their JSTL/tag library implementation. Is there a way to know if the generic JSP/servlet implementation is also as bad ?
thank you,
BR,
~A
Posted by anjan bacchu on September 15, 2005 at 01:16 PM MDT #
Posted by john on September 15, 2005 at 02:04 PM MDT #
Posted by john on September 15, 2005 at 02:06 PM MDT #
Posted by Matt Raible on September 15, 2005 at 02:45 PM MDT #
The lessons learned about how to make it more portable are valuable, though. :)
Posted by Mike Bosch on September 19, 2005 at 12:53 PM MDT #
It was dog-slow in the 3.x days (try anywhere up to an order of magnitude slower). 4.x was where Tomcat caught up some, but Resin was still 10-40% faster. Tomcat 5.x performance is quite good though.
Posted by Trent on September 22, 2005 at 10:06 PM MDT #