File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Apache File Serving efficience Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache File Serving efficience" Watch "Apache File Serving efficience" New topic

Apache File Serving efficience

Nestor Mata

Joined: Nov 07, 2006
Posts: 17
Hi Vivek Chopra/Sing Li/Jeff Genender

I've always use apache together with httpd or iis to use tomcat only as J2EE container and not as file server and using httpd or iis for this porpouse.
But, there are any benchmarks or information that shows how efective could be tomcat in relation to httpd for example, to justify why to handle them together and not use only tomcat.

I know there are many other reasons because httpd is able to support many other features not related with J2EE, like security, quotas, many other configurations, etc; but I'm interesting in see some information related to the efficience.

Best regards,
Nestor Mata
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

We (the folks at the Ranch) have written a little about this
In a nutshell, it depends on your application.
If most requests are being passed to Tomcat anyway (not a lot of static content) then it may actually be more efficient to run Tomcat as a standalone.
Even in cases where it is sightly slower to run Tomcat as a standalone, the headache of maintaining the connector over various Tomcat and HTTPD version upgrades may not outweigh the benefits.

You may be interested to know that Tomcat is now capable of running with the Apache Portable Runtime (APR) native libraries. This is essentially the heart of Apache HTTPD so you might be able to get the benefits you're looking for without having to deal with the connectors.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Vivek Chopra

Joined: Sep 18, 2000
Posts: 14
That is a great answer Ben.

To second what you said, some reasons for using a Web server to front Tomcat include stability (Web servers such as Apache are typically a lot more robust), Clustering and load balancing (the JK Connector has a good support for clustered Tomcat configurations) and support for legacy applications.

Performance used to be one of the reasons for selecting a Web server frontend, but this largely depends on the nature of your Web application. If your application has mainly dynamic content � i.e., servlets and JSPs � you will not see a significant performance difference by using Apache or IIS as a Web front to Tomcat. In fact, performance might decrease because an extra layer needs to be traversed by incoming requests. However, you may get improved performance if your Web application has a lot of static content, use of SSL etc. - although SSL performance too is not a real issue with Tomcat 6, due to its use of the APR Connector.

I don�t have performance benchmarks for Tomcat 6 and an Apache httpd front end, but I can point you to those for Tomcat 5.5, if this helps:

- Vivek

Vivek Chopra<br />Author of <a href="" target="_blank" rel="nofollow">Professional Apache Tomcat 6</a>
Nestor Mata

Joined: Nov 07, 2006
Posts: 17
Thanks a lot.

This are definitly good answers and things that I'll take into consideration for future developments.

Best regards,
Nestor Mata
I agree. Here's the link:
subject: Apache File Serving efficience
It's not a secret anymore!