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

    Learn More

    Building Universal Apache Tomcat Native Library on OS/X

    Last Updated on Jeudi, 1 décembre 2011 08:39 Written by Henri Gomez Mercredi, 13 juillet 2011 03:41

    I recently notice that my Apache Tomcat running on OS/X 10.6.8 couldn’t use Apache Tomcat Native Library.

    INFO: The APR based Apache Tomcat Native library which allows optimal
    performance in production environments was not found on the
    java.library.path:
    .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
    Jul 13, 2011 11:02:30 AM org.apache.coyote.http11.Http11Protocol init
    

    After digging around and with the help of ASFer Mladen Turk, I figure my previous build was stick to 64bits mode only and I switched my JVM to 32bits mode using -d32.

    The fix was then easy, just had to rebuild tomcat-native and asking OS/X gcc to produce both 32/64 bits model library using the following CLFAGS/APXSLDFLAGS.

    CFLAGS='-arch i386 -arch x86_64' APXSLDFLAGS='-arch i386-arch x86_64'
    

    Here is a small script I’m using now to produce Apache Tomcat Native Library on OS/X.

    curl http://mir2.ovh.net/ftp.apache.org/dist//tomcat/tomcat-connectors/native/1.1.20/source/tomcat-native-1.1.22-src.tar.gz -o tomcat-native-1.1.22-src.tar.gz
    tar xvzf tomcat-native-1.1.22-src.tar.gz
    cd tomcat-native-1.1.22-src/jni/native
    
    CFLAGS='-arch i386 -arch x86_64' APXSLDFLAGS='-arch i386 -arch x86_64' ./configure --with-apr=/usr --with-ssl=/usr --with-java-home=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
    make clean
    make
    
    sudo cp .libs/libtcnative-1.0.1.22.dylib /usr/lib/java
    sudo rm -f  /usr/lib/java/libtcnative-1.dylib
    sudo ln -s /usr/lib/java/libtcnative-1.0.1.22.dylib /usr/lib/java/libtcnative-1.dylib
    

    A note about Lion

    If you get Java on Lion using the java command on terminal or via the Java Developer Package for Mac OS X 10.7, Java headers are not on the usual location and you could find them under /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers

    You should then update the configure command line like this :

    CFLAGS='-arch i386 -arch x86_64' APXSLDFLAGS='-arch i386 -arch x86_64' ./configure --with-apr=/usr --with-ssl=/usr --with-java-home=/System/Library/Frameworks/JavaVM.framework/Versions/A/
    

    Lion came with Xcode 4.1 and there is also an impact on linker side, libtcnative is now produced as libtcnative-1.0.dylib

    Commands became so :

    curl http://mir2.ovh.net/ftp.apache.org/dist//tomcat/tomcat-connectors/native/1.1.20/source/tomcat-native-1.1.22-src.tar.gz -o tomcat-native-1.1.22-src.tar.gz
    tar xvzf tomcat-native-1.1.22-src.tar.gz
    cd tomcat-native-1.1.22-src/jni/native
    
    CFLAGS='-arch i386 -arch x86_64' APXSLDFLAGS='-arch i386 -arch x86_64' ./configure --with-apr=/usr --with-ssl=/usr --with-java-home=/System/Library/Frameworks/JavaVM.framework/Versions/A/
    make clean
    make
    
    sudo cp .libs/libtcnative-1.0.dylib /usr/lib/java
    sudo rm -f  /usr/lib/java/libtcnative-1.dylib
    sudo ln -s /usr/lib/java/libtcnative-1.0.dylib /usr/lib/java/libtcnative-1.dylib
    
    Learn More
    Designed by RocketTheme
    WordPress is Free Software released under the GNU/GPL License.