Tomcat – Is Tomcat Native worth the trouble

performancetomcatweb

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.

Best Answer

(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.