Re: mod_proxy timeout problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19/02/2013 14:37, Pavel Mateja wrote:
Can anyone give any clues as to what might be causing a timeout problem
with mod_proxy being used as a reverse proxy to a local app server. This
is using httpd 2.2.23 on ubuntu 10.04 LTS i686

I've (hopefully) eliminated the network itself as a source of the
problem by testing this with the app server running on the same box as
apache, using 127.0.0.1 as the network address in the proxy config.

Even like this, I still get occasional '(70007)The timeout specified has
expired: proxy: prefetch request body failed to 127.0.0.1:4000
(127.0.0.1)' messages in the logs.

The app server shows the socket accept happening at the point the
request is made, but then just sticks in a select() call until the
timeout occurs (set to 5 seconds). No data is recieved from the apache
mod_proxy.

The apache logs then get the error message shown above added to them.

The connection that mod_proxy is using is plain http, not https. This
seems to happen maybe once or twice a day, no apparent pattern with
system load, client type, url being requested etc.

Is there anywhere that details the different error log messages that
mod_proxy can generate, what they actually mean, and possible causes of
them. I'm not even sure in this case if 'prefetch request body failed'
relates to getting data from the app server or getting it from the web
browser client (the error has 'to 127.0.0.1' in it which makes me think
it relates to getting data from the app server)

Is there any enhanced logging I can add to mod_proxy, for example to
show it making the connection, packets sent, packets recieved etc. I
just can't see why this timeout fails with mod_proxy not sending any
data to the app server. Does mod proxy need the entire request from the
browser before it forwards it on (what about requests with large post
data? - though that is not the case in these errors). Can it have a long
delay between making the connection to the app server and actually
starting to transmit the request?

Thanks for any hints/tips.
Hi,
do you use keepalive in your proxy?
I had so set something like
ProxyTimeout 41
Timeout 40
on proxy and
Timeout 45
on backend because there is tiny race when backend closes connection just in
the moment proxy tries to reuse that connection.

The proxy settings I'm using at the moment are:

ProxyRequests Off
ProxyErrorOverride On
ProxyPreserveHost On
ProxyTimeout 600
ProxyVia Off

<Proxy balancer://appserver>
BalancerMember http://127.0.0.1:4000 loadfactor=1 max=100 disablereuse=On
ProxySet lbmethod=byrequests
</Proxy>

### Normally the balancer has more than one member, distributed over different servers but whilst trying to get to the bottom of this I've set it to just a single instance on the local box.

I've also tried disabling re-use by setting the nokeepalive and 1.0 request options in the <location> section that sets the reverse proxy:

<Location /tools/>
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
ProxyPass balancer://appserver/tools/
</Location>

Using this the proxy does seem to be closing the connection immediately after each request. With the error I received today (the timeout shown above) it was at the start of a new connection, with no existing open connection to apache. The previous request from the same client had been almost 4 minutes earlier.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux