Re: client disconnection when server goes down

From: John Leach <john#brightbox.co.uk>
Date: Thu, 28 Apr 2011 09:59:55 +0100


On Sun, 2011-04-24 at 23:16 +0200, Willy Tarreau wrote:
> Hi John,
>
> On Sun, Apr 24, 2011 at 09:35:10AM +0100, John Leach wrote:
> > Hi,
> >
> > I'd like haproxy to actively disconnect clients when the backend server
> > they are using changes state to down. Is this possible?
>
> No this is not possible right now. There is no per-server connection list
> so it's not possible to kill connections that are established.

Ok, thanks Willy.

> Also, it
> is not always desired to do so, many people use health checks to stop
> accepting new connections.

In this case, I'm using haproxy to do fail-over for mysql connections. If a mysql server stops responding (i.e: anything short of sending a tcp reset), haproxy detects it and sets it as down, but the clients still connected to that server sit there until tcp times out, which can be a long time.

I've fixed this by patching the client software to do it's own timeout (arguably the correct way to fix this :), but instead it would be nice if haproxy could send a tcp reset when the state changes to down. It would be very handy!

I'd imagine the same would go for other long running, often idle connections, such as websockets.

Thanks,

John. Received on 2011/04/28 10:59

This archive was generated by hypermail 2.2.0 : 2011/04/28 11:15 CEST