Hi Malcolm,
On Fri, May 14, 2010 at 12:07:53PM -0700, Malcolm Handley wrote:
> Hi, everyone.
>
> I'm having some trouble with the routing of requests to servers within a
> backend.
>
> Firstly, although I have "retries 3" in the defaults section of my config
> file I'm not seeing any evidence of retries. If a server is down but has not
> been detected as down by haproxy then a request may still get sent to it and
> a failure returned to the client. (This is the first bold line in the log
> below.)
Yes, this is expected if your "retries" value is not large enough to cover the time to detect that the server is down. Also, the retries are only performed on the same server. If you want the request to be redispatched to another server after the last attempt, you should use "option redispatch".
> Second, occasionally haproxy seems to route a request to a server that it
> knows is down. (This is the second bolded section below.)
No, if you look more closely, you'll see that the request was received at 04:03:20.475, *before* the server was marked down (04:03:21), and failed last attempt at 04:03:23. Since the request did not switch to another server on the last retry, I think you did not have "option redispatch" enabled.
> I could understand both of these if I were using cookies for routing and had
> not enabled redispatching. But I'm using "balance leastconn" with no mention
> of cookies in the config file. What else might I be doing that would force
> haproxy to use a downed backend and not retry requests?
Well, be careful, retries are always performed on the same server, except the last one which can be redispatched. I will study if we could force an early redispatch in case the server changes state during retries, but there's nothing certain in this area.
Regards,
Willy
This archive was generated by hypermail 2.2.0 : 2010/05/14 23:45 CEST