Servlet containers, startup time

Last Updated on Vendredi, 15 juillet 2011 01:12 Written by Henri Gomez Vendredi, 15 juillet 2011 12:11

With the release of JBoss AS7, we see many comments around about the startup time of Application Servers.
Even if this appears marginal in real life (an application server is expected to run 24/24 7/7), there is area where startup time is still important like for developpers. In developpment phase, when you have to start/stop your server dozens of times by day, you need fastest start time as possible.

I conducted a very basic and simple test on my MacBook Pro, take various application servers and servlet containers and measure their startup time.

And in this days of Java 7 fever, try these servers with OpenJDK 7 (OS/X version).

Results on MacBook Pro – Core2Duo 2.66Ghz

Startup Time of App Servers (3rd try)

all time in millisecondes

Remarks

  • JBoss AS 6 (minimal profile) startup time was about 27s. I didn’t include it in graph to keep a good scale for others engines
  • JBoss AS6 seems to start well with OpenJDK 7 but was a bit long to stop, so I had to kill the process
  • JBoss AS7 web-profile and non certified full edition came with no webapp, so a bit less works at startup since no webapp has to be deployed and managed. Injecting a basic webapp take an extra 30ms on next starts.
  • All servers performed pretty the same under Apple JDK 1.6.0-26 and OpenJDK 7.
  • Conclusions

  • Jetty is still the fastest container to start around.
  • Apache Tomcat team does a good job on Apache Tomcat 7, near twice faster than Apache Tomcat 6 in startup time and not too far than Jetty.
  • JBoss AS7 startup speed improvements are tremendous, about 13 times faster than its predecessor JBoss AS6, congrats guys !
  • Raw startup time data available here


    6 Comments

    1. Fred Bricon   |  Vendredi, 15 juillet 2011 at 0 h 22 min

      Tuning the JVM options can shave off a few more hundred ms with AS7 (most certainly other AS as well) :
      ex: -server -Xms128m -Xmx128m -XX:MaxPermSize=128m -Djava.net.preferIPv4Stack=true -XX:+UseFastAccessorMethods -XX:+TieredCompilation -Xverify:none

      See http://community.jboss.org/wiki/AS7StartupTimeShowdown for more details

    2. Henri Gomez   |  Vendredi, 15 juillet 2011 at 0 h 34 min

      Hi Fred,

      I was using standard settings, ie for JBoss AS 7 ( -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman)

      I tried your preconised settings (adapting to OS/X -> -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -XX:+UseFastAccessorMethods -XX:+TieredCompilation -Xverify:none -Djboss.modules.system.pkgs=org.jboss.byteman) and see startup time from 2000ms to 2300ms.

      Using a near settings for Tomcat 7 (-Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -XX:+UseFastAccessorMethods -XX:+TieredCompilation -Xverify:none) make startup time between 800 et 1000ms.

      So more gain for JBoss AS7 in such case.

      Thanks for pointing this one !

    3. Alexis MP   |  Vendredi, 15 juillet 2011 at 2 h 56 min

      Salut,

      Are these cold or warm startup times? On my 4+ year-old macbook (2.2GHz Core 2 Duo), I get the following warm startup times (with out-of-the-box VM options). First Apple JDK, second OpenJDK 147 :

      [#|2011-07-15T04:39:36.661+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|GlassFish Server Open Source Edition 3.1 (43) startup time : Felix (1,872ms), startup services(829ms), total(2,701ms)|#]

      [#|2011-07-15T04:42:56.146+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|GlassFish Server Open Source Edition 3.1 (43) startup time : Felix (4 013ms), startup services(1 298ms), total(5 311ms)|#]

      Also I suspect you might be using a default 64-bit JVM with OpenJDK which could explain the longer startup time for GlassFish. Using the Web Profile could possibly also gain a few 100ms. Of course Tomcat and Jetty are faster to start but the difference with complete Java EE 6 stacks is becoming negligible.

      cheers,
      -Alexis

    4. Alexis MP   |  Vendredi, 15 juillet 2011 at 2 h 59 min

      Also I wonder why you would need to « start/stop your server dozens of times by day ». That sounds really a lot to me and I wonder why you would need to do this.

    5. Henri Gomez   |  Vendredi, 15 juillet 2011 at 5 h 51 min

      Hello Alexis

      I do many start/stop before taking the measure for various containers. I used ./bin/startserv with out-of-the-box VM options.
      I retried and seens :

      [#|2011-07-15T07:48:28.259+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|GlassFish Server Open Source Edition 3.1 (43) startup time : Felix (1?586ms), startup services(734ms), total(2?320ms)|#]

      [#|2011-07-15T07:49:17.411+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|GlassFish Server Open Source Edition 3.1 (43) startup time : Felix (1?710ms), startup services(668ms), total(2?378ms)|#]

      [#|2011-07-15T07:49:37.585+0200|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=1;_ThreadName=main;|GlassFish Server Open Source Edition 3.1 (43) startup time : Felix (1?477ms), startup services(657ms), total(2?134ms)|#]

      I don’t know what happened last night, I’m updating graph right now.

    6. Jason   |  Vendredi, 15 juillet 2011 at 23 h 58 min

      Note that GF is executing a client vm in 32 bit, whereas JBoss AS7 is using 64 bit in server vm. This makes quite a bit of difference. The tiered compilation option listed above gives you a lot of the benefits of client but without sacrificing runtime perf

    Leave a Reply