Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Apache File Serving efficience

 
Nestor Mata
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We (the folks at the Ranch) have written a little about this
here.
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.
http://tomcat.apache.org/tomcat-6.0-doc/apr.html
 
Vivek Chopra
Author
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

http://cvs.apache.org/~woolfel/benchmark_summary.doc
http://cvs.apache.org/~woolfel/benchmark_summary.sxw
http://cvs.apache.org/~woolfel/tc_results.html

- Vivek
 
Nestor Mata
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.

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

Best regards,
Nestor Mata
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic