A little background: I have a webapp that has both Servlet/JSP dynamic content and static files. Pages are always dynamic, and ~10 static resources are served for each page. Everything is served over HTTP (Tomcat Native seems to help more with HTTPS). I plan on hosting this webapp under Tomcat 7 and Java 6.

I'm debating whether or not to use Tomcat Native. Is it worth the trouble/risk, or these days, is Hotspot fast enough that I'm better off not bothering with Tomcat Native? At the end of the day, I'll probably benchmark the two, but I'm also looking for people's experiences.

  • Can you say something about the "trouble/risk" that you are concerned about? On Ubuntu it's a simple "apt-get install libtcnative-1" to install, and there doesn't seem any configuration necessary (see tomcat.apache.org/native-doc) – Dan Mar 9 '12 at 17:44
  • I'll probably be compiling it on my own, so the "trouble" is ~30 minutes of poking around...which isn't much, but if the benefit is negligible, it still might not be worth the time. As for risk, it's native code--one segmentation fault might be able to take down the JVM. – David Ehrmann Mar 9 '12 at 23:11

(Disclaimer: I've no data to back this claim).

I've found out that native Tomcat (APR) helps more with SSL/HTTPS. It still is a lot slower than, say, Apsis Pound doing SSL on a separate machine.

For static files, the APR seems to help with memory-mapping the static resource and makes things a little faster when in the order of hundreds of requests/sec, but then again the correct HTTP caching of static resources helps a lot more (since not so many requests for the static resource come in).

All in all, I don't think it's worth it, if you're going to compile everything by hand (you'd be out of Java-land).

If it's a simple apt-get install, go for it.

In any case, I'd invest more in Pound SSL termination or Varnish caching.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.