28

I am trying to understand what is happening with the following message in our Apache 2.2 error_log:

Wed May 18 21:03:29 2011] [error] [client 172.20.10.10] (70007)The timeout specified has expired: proxy: error reading status line from remote server super-load1-ga.test.com, referer: https://tester2.test.com/boom/ga/inside.asp

We are running Apache 2.2 with mod_proxy. Is this Apache timing out the request related to its 5 min TimeOut value in the httpd.conf? (Meaning it does not recieve a response from the remote server in 5 min.) Or is this simply a response from the remote server saying that it cannot handle the connection?

Apache quickly runs out of its MaxClients around the time I see this error.

Quick example of Proxy entry:

ProxyPass /boom/ga https://super-load1-ga.test.com
ProxyPassReverse /boom/ga https://super-load1-ga.test.com
splattne
  • 28,508
  • 20
  • 98
  • 148
roacha
  • 447
  • 1
  • 6
  • 9

3 Answers3

41

You increase the timeout in the ProxyPass directive:

ProxyPass /boom/ga https://super-load1-ga.test.com connectiontimeout=300 timeout=300

Timeout values are in seconds.

  • 8
    If you're not already defining the ProxyPass timeout argument, your global `Timeout` value will be used. See http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxytimeout and http://httpd.apache.org/docs/2.2/mod/core.html#timeout – sync May 02 '14 at 04:36
  • I am also geeting error The timeout specified has expired ....I have ProxyRequests Off so is this related ? should i make it on to increase timeout ...... – Ashish Karpe Dec 02 '15 at 11:50
4

It sounds like your server at https://super-load1-ga.example.com is taking too long to respond.

In that scenario, if it just sits there then the Apache process is going to wait for it. That process is essentially blocked, i.e. cannot do anything else. If you don't time out quick enough, you're going to run out of Apache processes and hit MaxClients which seems to all make sense.

You should have logs on the super-load1-ga.test.com site to see how long requests are taking, they must be taking an age.

You could potentially shorten the timeout on the ProxyPass connection

http://httpd.apache.org/docs/current/mod/mod_proxy.html#workers

Patrick Mevzek
  • 9,921
  • 7
  • 32
  • 43
Philip Reynolds
  • 9,799
  • 1
  • 34
  • 33
  • Thanks for the great response Phil. So you think this is hitting the main httpd.conf TimeOut value of 5 min and Apache is timing out the session? Because I don't have a proxy specific timeout set it would default. On the Proxy timeout suggestion do you think I should use the ProxyTimeout variable or the ProxySet command? (ProxySet connectiontimeout=5 timeout=30 ) – roacha May 21 '11 at 00:22
  • cool DP @Patrick Mevzek – Monish Sen Nov 24 '20 at 06:41
3

To answer your question, yes, Apache2 httpd in proxy mode does log that error message when Apache2 httpd times out. If the server connected to the Apache2 httpd in proxy mode was the cause there would be a different message.

The message has multiple parts: The timeout specified has expired is the text equivalent of the APR_TIMEUP error code, see:

srclib/apr/misc/unix/errorcodes.c

case APR_TIMEUP:
    return "The timeout specified has expired";

Then proxy: error reading status line from remote server super-load1-ga.test.com is in

modules/proxy/mod_proxy_http.c

If you crank up your log level to APLOG_DEBUG you should see an additional message: proxy: read timeout too.