[Mongrel] proxy errors with apache2.2.3 + mongrels
rob at robmela.com
Thu Oct 18 09:30:57 EDT 2007
What I'm not seeing in those bug reports is "Connection Refused" errors.
As an aside, I bet that as of Apache 2.2.4 "SetEnv proxy-nokeepalive 1 "
is no longer needed. One cause of the "error reading headers" error
was that up until 2.2.4 mod_proxy wasn't checking to see whether a
previously used socket was still good or not before using it for the
next request. The fix is in 2.2.4. It makes sense that turning
keepalives off for proxy connections works. It probably makes Apache
reconnect for each request: a blank slate. That's a practical option
if you've got a few dozen to a hundred requests per second.
So two possible causes of error reading response headers are:
1) Mongrel has hit 950 workers ( or whatever num_processors is ) --
unlikely, I suppose, unless there's a bug in Mongrel's tracking of
worker list length.
2) Apache attempted to read/write to a bad socket
The no-keepalives probably addresses the second case. I'm not sure what
it does in the first case. The way mod_proxy checks is to read a zero
byte buffer off the socket. If Mongrel just closes right away I'm not
sure what state the socket's in at the client ( mod_proxy ) side of
things -- whether it's in close_wait or whatever -- and what a zero-byte
read would return.
This is one reason why returning a 503 from Mongrel would be helpful --
it'd be nice to rule out the num_processors accept/close right off the
bat, however unlikely it may be deemed.
It might be worth upgrading to Apache 2.2.6 and seeing whether that
fixes the issue. It's a crap shoot, done without fully understanding
the problem, but if it works, what the heck -- it makes your day better.
Anyhow, I'm really interested in the outcome of this -- we rely on
mod_proxy_balancer, and I want to be sure I understand it.
Rafael G. wrote:
> Jacobo Garcia escribió:
>> [Tue Oct 16 23:28:01 2007] [error] [client 184.108.40.206] proxy: error
>> reading status line from remote server bomber, referer:
> We had this problem and solved it adding the following lines in our
> apache conf:
> #Fix for Apache bug 39499
> SetEnv force-proxy-request-1.0 1
> SetEnv proxy-nokeepalive 1
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 123 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20071018/b737e6c3/attachment.vcf
More information about the Mongrel-users