Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it a bad idea to use Apache HTTPD to proxy tomcat

Tags:

apache

tomcat

Fronting tomcat with httpd solves a big problem for us. We can separate httpd and tomcat to different machines, i.e., put the sever that hosts httpd in DMZ and leave the server that hosts tomcat behind a more secure firewall, as it needs to make database connections, which is not allowed from within DMZ. We use AJP (mod_proxy_ajp).

We haven't seen any performance issues in our production environment. But I bumped into the following recently "Whatever you do, using Apache HTTPD to proxy your requests should be avoided at all costs, as it will decrease your performance by nearly 50%." from http://www.mulesoft.com/tomcat-performance.

I'd like get people's expert opinion regarding the statement.

Thanks,

like image 766
hhe Avatar asked Mar 23 '12 17:03

hhe


1 Answers

Is it a bad idea to use Apache HTTPD to proxy tomcat

NO, it can actually speed up services if configured and utilized correctly. Just keep in mind what environment you're using it in. It may not be necessary to run this in a development environment or internal private network, unless you're running a mixed environment of different services on the same server.

In fact, you can take a ton of load off tomcat by proxying request through Apache. You can setup Apache to perform all compression, encryption, and CA Cert management, while at the same time proxing request via AJP to tomcat. You can also leverage it to run multiple services off the same server using virtual hosts and sub-domains.

We haven't seen any performance issues in our production environment. But I bumped into the following recently "Whatever you do, using Apache HTTPD to proxy your requests should be avoided at all costs, as it will decrease your performance by nearly 50%." from http://www.mulesoft.com/tomcat-performance.

It's all according to how you setup Apache and what protocols you configure for proxying. Some protocols and modules are slower than others. However, I haven't seem much degradation as a result of using AJP with mod_proxy. It's been working great. Plus we also use mod_security for added intrusion and exploit detection.

One of the biggest advantages, which comes with Apache, is the ability to load balance and scale services.

like image 87
Jason Huntley Avatar answered Nov 03 '22 00:11

Jason Huntley