Wednesday September 19, 2007
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. ;-) Posted in Java at Sep 19 2007, 04:55:31 PM MDT 16 Comments
Proposed Tomcat Enhancement: Add flag to escape JSP's EL by default I posted the following to the Tomcat Developers mailing list. Unfortunately, it didn't get any responses, which means (to me) that no one cares about this feature. I guess the good thing is they didn't veto it.
Hello all,
I'm working for a client that's using a proprietary Servlet/JSP-based framework that runs on Tomcat. They have their own custom JSP compiler and they're looking to move to a standard JSP compiler. One of the things their compiler supports is automatic escaping of XML in expressions. For example, ${foo} would be escaped so <body> -> <body>. JSP EL does not do this. It *doesn't* escape by default and instead requires you to wrap your expressions with <c:out/> if you want escaping.
I'd like to ask what developers think about adding a flag (similar to trimSpaces in conf/web.xml) that allows users to change the escaping behavior from false to true?
I think this is a good option to have as it allows security-conscious organizations to paranoid and escape all content by default.
Thanks,
Matt
Related: http://raibledesigns.com/rd/entry/java_web_frameworks_and_xss
What do you think? Is there anything wrong with adding this (optional) feature to Tomcat? Enhancing security is a good thing - right?
Update: I've entered an enhancement request for this feature and attached a patch. Posted in Java at Sep 19 2007, 04:29:11 PM MDT 7 Comments
Search This Site
Recent Entries
- What's wrong with JSF
- Why such a busy week?
- New Passport in 9 Days
- EhCache Project Busy this Summer
- Spontaneous Stuff Weekend
- Awesome Birthday Present: A Kegerator
- Maven Plugin for Running Integration Tests against Multiple Containers
- Presenting Web Frameworks of the Future Tomorrow in Denver
- My OSCON Aftermath
- OSCON 2008 Wrapup