tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Any reason to use Apache w/ Tomcat for webapp with all dynamic web pages?
Date Tue, 02 Oct 2001 04:32:53 GMT


On Mon, 1 Oct 2001, David Wall wrote:

> Date: Mon, 1 Oct 2001 20:26:44 -0700
> From: David Wall <dwall@Yozons.com>
> Reply-To: tomcat-user@jakarta.apache.org, David Wall <dwall@Yozons.com>
> To: tomcat-user@jakarta.apache.org
> Cc: craigmcc@apache.org
> Subject: Re: Any reason to use Apache w/ Tomcat for webapp with all
>     dynamic web pages?
>
> > * If you have lots of static content that can be served from a directory
> >   other than the webapp's context path  (right now, current Tomcat
> >   versions serve static content within the webapp directory faster
> >   stand-alone than they do behind Apache).
>
> Craig, what happens if the images are IN the webapp's context path?  Seems
> like Apache still serves them up without Tomcat,

Yes, that's true for many web connector setups.

> though I don't know if
> there's a performance hit (like Apache asks Tomcat, tomcat says not found,
> and then Apache looks for it in its directories) or not.
>

It depends on the programming of the web connector you are using.  Of the
choices available:

* mod_jserv (Tomcat 3.x only) - slower than Tomcat stand-alone

* mod_jk (Tomcat 3.x or 4.x) - application dependent, requires significant
  investment in configuration tuning

* mod_webapp (Tomcat 4.x only) - current implementation forwards all
  requests for static files to Tomcat (and is thus slightly slower than
  Tomcat stand-alone), but the protocol is designed to take maximum
  advantage of Apache's ability to serve static content that is not
  protected by a security contraint or processed by a filter.

> I know that Apache will serve up an image in a path like
> /app/images/pretty.gif even if /app is mapped to Tomcat (maybe I answered my
> own question, since I map /app/*.jsp and /app/servlet/* rather than /app/*).
>

There is ***ABSOLUTELY***, ***POSITIVELY***, no blanket statement about
performance of Apache+Tomcat versus Tomcat standalone that is accurate
under all circumstances.

However, the old conventional wisdom ("Apache+Tomcat serves static content
from a web app faster than Tomcat standalone") is either inaccurate, or
irrelevant, in a rapidlly growing number of use cases.  The ***only*** way
to find out for sure what works best for you is to try ***your***
application both ways.

Don't believe anyone who tells you one way is *always* better or faster.

> David
>
>

Craig



Mime
View raw message