~ramon-van-alteren/mysql-proxy/funnel-private-backend

Viewing all changes in revision 661.

  • Committer: ramon
  • Date: 2009-04-06 12:00:28 UTC
  • Revision ID: ramonvanalteren@hurin.hyveshq-20090406120028-j6cwhl5y2zspm9u4
Added keepalive and keepalive options to client sockets


We're facing a problem were at night when traffic is low the loadbalancer kills any open connections
due to timeout, however both client and server still think this connection is alive.
In the morning, all connections become more active fast, resulting in a mass of new client connections
while the old ones still have open sockets on the mysql-proxyed server.
This results in out-of-socket memory errors and a hungup server.

The code adds keepalive options to the client socket which results in sending a keepalive packet 
every 2 minutes. This will ensure that the loadbalancer does not kill the connection

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: