We have Apache 2.2.24 in front of Tomcat 7.0.33. We're using AJP connectors with APR/native configured. I recently noticed a number of 500 errors in the Apache access logs for a small proportion (0.3%) of requests to one particular resource. For each of these 500 responses there is a corresponding pair of error lines in the Apache error log
[Wed Mar 06 04:07:42 2013] [error] ajp_read_header: ajp_ilink_receive failed
[Wed Mar 06 04:07:42 2013] [error] (70007)The timeout specified has expired: proxy: read response failed from (null) (*)
The time logged for the errors is between 5:06 and 5:07 minutes after the time logged for the request. Matching the Timeout 300
directive that is set. Nothing is logged on the Tomcat access log so I'm presuming the request never reaches there.
Presumably there is some performance issue with the resource (it does a DB update and has quite a high load) but I'm more concerned here about understanding what is going on with the communication between Apache and Tomcat:
- at what point have the requests timed out? (connecting, reading etc)
- what options do I have for monitoring the number of ajp connections?
- what options do I have for configuring Apache and Tomcat to improve the situation
Apache is configured using a rewrite rule with the flag [proxy,last]
. The Tomcat connector looks like
<Connector port="8014"
enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
Like I said previously I'll be working on fixing the bottleneck on the Tomcat resource separately to this.
0 Answers