I've stumbled into similar-ish problems, essentially the haproxy-server connection timing out and closing. In my particular case, the backend is a MySQL server, but I figure the issue is essentially the same. I've not yet put my system into full production, so I don't know if the MySQL servers would get overloaded w/connections similar to your Apache servers.
But the gist for me is, if there is a way to maintain the client-haproxy and haproxy-server connection for "as long as needed" (admittedly a vague term), that'd be great. I've tried the tcpka and that didn't seem to take. My work-around for now is simply to make a "hopefully long enough timeout server value" but isn't "too long" and my fingers crossed. Separately, if I stopped using haproxy and just used Linux LVS-DR (or LVS-NAT) does anyone know if this issue goes away? I figure the problem is because I have a "proxy" so to speak? I've not implemented LVS-DR/NAT yet because I found HAProxy to be so much simpler. PH PS I did look into Mysql-Proxy, but that doesn't seem to work very well for me. It looked trivial (download binary and just to mysql-proxy mysqlserver1 mysqlserver2....) But the load-balancing and failure detection didn't seem to work too well. On Fri, Dec 4, 2009 at 10:48 AM, Naveen Ayyagari <[email protected]> wrote: > Hello, > We have come across a situation where occasionally our backend servers get > overwhelmed with connections. > > It appears as though haproxy 'timeout server' value is getting hit which > drops the connection to the server, however the server continues to execute > the request even though the response will be ignored. > > We are using apache on our backend servers and have not been able to figure > out how to get apache to abort processing on a connection when haproxy times > out. What ends up happening is that, haproxy times out the connection, then > it thinks that it has an available connection to serve a new client and opens > a new connection to the apache server. This ends up with the apache server > getting way more concurrent connections than we have configured haproxy to > allow, and in some cases brings our servers to halt as they run out of memory > because of the number of connections being opened. > > Has anyone else had issues like this or have suggestions on a best practice > to manage this kind issue? I would have hoped that apache would terminate the > process when haproxy dropped the connection, but it does not appear to behave > in this manner. > > > Thanks for any help or suggestions? > --Naveen > > >

