Apache and ajp performance

apache-2.2performance-tuning

I have an apache sitting in front of two tomcat app servers(one on the same physical server, the other on a different one) that does time consuming work(0.5 sec to 10sec per request). The apache http server is getting killed by an average of 1 to 2 concurrent requests per second. both Server spec is about 2GB of RAM. Is there a way to optimize apache to handle the load? any advise is welcome.



BalancerMember ajp://localhost:8009/xxxxxx
BalancerMember ajp://XXX.XX.XXX.XX:8009/xxxxxx

I keep getting the following in apache2.2 log:

[Mon Dec 28 00:31:02 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Mon Dec 28 00:31:02 2009] [error] (120006)APR does not understand this error code: proxy: read response failed from 127.0.0.1:8009 (localhost)

Best Answer

you could balance your load across the two servers. Try to give more load to the standalone tomcat. You'll find same examples here: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass

The error message looks like your tomcat isn't giving back any response. Did you take a look at your tomcat logs? Perhaps the tomcats have some trouble and apache is keeping connections open. This could also be a source for apache givving up. Do you have mod_status installed on your apache? This could give you some additional hints.

Christian