GlassFish 2 vs. Tomcat 6
In Switched, Dave says:
Now that Glassfish V2 is out I'm switching from Tomcat to Glassfish for all of my development. It's more than fast enough. With Glassfish on my MacBook Pro, Roller restart time is about 8 seconds compared to 16 with Tomcat. And the quality is high; the admin console, the asadmin command-line utility and the docs are all excellent. The dog food is surprisingly tasty ;-)
I did some brief and very non-scientific performance comparisons myself:
Startup Time with no applications deployed:
- Tomcat 6: 3 seconds
- GlassFish 2: 8 seconds
Startup Time with AppFuse 2.0 (Struts + Hibernate version) as a WAR
- Tomcat 6: 15 seconds
- GlassFish 2: 16 seconds
Environment:
- JAVA_OPTS="-Xms768M -Xmx768M -XX:PermSize=512m -XX:MaxPermSize=512m -Djava.awt.headless=true -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+UseConcMarkSweepGC -server"
- OS X 10.4.10, 2.2 GHz Intel Core 2 Duo, 4 GB 667 MHz DDR2 SDRAM
Since this was a very non-scientific experiment, it's possible the last two are actually the same. It's strange that Dave is seeing Roller startup twice as fast on GlassFish. Maybe they've done some Roller deployment optimization?
I realize startup times aren't that important. However, as Dave mentions, they (and context reloading) can be extremely important when developing.
Update: I got to thinking that Dave is probably referring to context reloading. Here's a comparison of how long it takes for both servers to pick up a new WAR (and start the application) when it's dropped into their autodeploy directories.
- Tomcat 6: 14-16 seconds
- GlassFish 2: 9 seconds
The strange thing about Tomcat is it takes 6-8 seconds to recognize a new WAR has been deployed. Does Tomcat have a polling increment that can be increased during development?
Regardless, it's impressive that the GlassFish guys have made things that much faster for developers. Nice work folks!
These days, I try to use mvn jetty:run on projects. Then I don't have to worry about deploying, just save and wait for the reload. Time to wait for AppFuse 2.0 to reload using the Maven Jetty Plugin (version 6.1.5)? 7 seconds. Of course, it'd be nice if I could somehow get this down to 1 or 2 seconds.
Maybe Dave should use the Maven integration for Roller to decrease his reload times. ;-)
After reading your post, I remembered I did some tinkering getting Tomcat to reload a context when classes were recompiled. Looking back, there's an "unloadDelay" attribute you can specify for a context. Look at my post for more details:
I will definitely consider Glassfish for development in the future although lately I've been having too much fun with Ruby :P
Posted by Shane Witbeck on September 20, 2007 at 01:23 AM MDT #
re: "mvn jetty:run" ... I hope we will be able to do that type of things on the GFv3 branch soon. The basic mechanism is already there, as shown by the GlassFish v3 Gem.
re: Nice work folks! ... I agree. The whole development team and community have done a great job.
- eduard/o
Posted by Eduardo Pelegri-Llopart on September 20, 2007 at 01:36 AM MDT #
Posted by Kenneth Mark on September 20, 2007 at 02:58 AM MDT #
Posted by Kocka on September 20, 2007 at 11:44 AM MDT #
Posted by Ricardo on September 20, 2007 at 01:25 PM MDT #
Ricardo, I agree the Jetty Launcher is a nice solution. However, I tend to use IDEA more than Eclipse lately.
In both IDEs, it's pretty easy to setup an External Tool and icon that you can use to run "jetty:run". However, most of the time you don't need to restart Jetty.
Posted by Matt Raible on September 20, 2007 at 01:46 PM MDT #
GlassFish v2 has a hidden feature[1] that does something similar to what Jetty's Maven plugin. It is not as good as what Jetty does, but still interesting to use (at least I use it) :-)
-- Jeanfrancois
[1] http://weblogs.java.net/blog/jfarcand/archive/2006/01/fast_web_applic_1.html
Posted by Jeanfrancois Arcand on September 20, 2007 at 05:08 PM MDT #
Posted by Ron Chan on September 20, 2007 at 08:33 PM MDT #
Posted by Bruce Snyder on September 20, 2007 at 11:55 PM MDT #
Posted by Eelco Hillenius on September 22, 2007 at 11:24 PM MDT #
Posted by Tim Morrow on September 24, 2007 at 04:29 PM MDT #
Posted by Mirror on October 03, 2007 at 11:05 PM MDT #
Posted by geetan on March 06, 2008 at 07:09 AM MST #
Posted by Matt Raible on March 06, 2008 at 07:58 AM MST #
Posted by Earl on May 12, 2008 at 02:13 AM MDT #
Posted by levan on August 04, 2008 at 09:41 PM MDT #
Posted by C on September 18, 2008 at 02:35 AM MDT #
Posted by 211.94.143.54 on October 30, 2008 at 07:28 AM MDT #