tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred Janon <>
Subject Re: [OT] redirecting people to maintenance mode
Date Fri, 24 Aug 2012 16:02:12 GMT
Hi Chris,

Excellent, thanks for all these suggestions. I never really understood why
Tomcat standalone would be that much slower than something else serving
files like you pointed it out. So good things to look at and try out.
thanks for the SSL pointer as well, I need it.

Thanks again.


On Fri, Aug 24, 2012 at 5:22 PM, Christopher Schultz <> wrote:

> Hash: SHA1
> Fred,
> (Marking OT because this strays from the OP's topic)
> On 8/23/12 4:21 PM, Fred Janon wrote:
> > I am interested in more details from your comment:
> >
> > "This is a common misconception: Apache httpd is *not* faster than
> > Tomcat for static content *when configured appropriately*. The
> > current default configuration is unfortunately much less optimized
> > than Apache httpd's default configuration, so httpd beats Tomcat
> > out-of-the-box."
> >
> > Do you mean the Default Servlet configuration (
> > )or
> > any servlet?
> The DefaultServlet is perfectly capable of delivering content quickly
> (it's just copying bytes from the disk, which isn't that difficult).
> IF you have another servlet that delivers static content, then you'll
> have to look at it to see if it is wasting any time :)
> > Where can I learn more about optimizing serving static content with
> > Tomcat? I want to stick with Tomcat alone.
> Your best bet when using Tomcat standalone is to use either the NIO or
> APR connectors with "sendFile" support enabled: this is the key. See
> my presentation from ApacheCon NA 2012 on the subject
> (
> )
> - -- although Mladen pointed out at that presentation that my data was
> irrelevant due to the use of Linux's loopback interface for all my
> testing. He's got a point, but the data still suggests that
> performance of NIO+sendFile/APR+sendFile is always on par with Apache
> httpd and the performance of the BIO connector and either NIO or APR
> without sendFile is always relatively bad.
> When you think about it, Tomcat ought to have almost identical
> performance with using APR+sendFile connector because it is the *same
> code that Apache httpd uses* under the hood (that's what APR is:
> native code shared with Apache httpd, including the "sendFile"
> support). The fact that the NIO connector is so competitive with APR I
> think speaks to the optimization that has occurred within the NIO
> stack, allowing the data to get to the hardware with very little overhead.
> One more thing: if you are using TLS, you definitely want to go with
> the APR connector to use OpenSSL-based encryption: it's much faster
> than the JSSE-based encryption that you'll get when using the NIO
> connector.
> - -chris
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools -
> Comment: Using GnuPG with Mozilla -
> iaYAoK8svXqiCxZJxALb9I7eUkIZkcuC
> =tsTE
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message