djveremix / redis

Automatically exported from code.google.com/p/redis
0 stars 0 forks source link

add TCP keepalive configuration options for client connections #224

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect a client or slave to a master via a proxy or loadbalancer (such as a 
LVS setup using 
TCP tunneling)
2. Keep the client idle for some time (depends on the config of the proxy or 
loadbalancer)
3.

What is the expected output? What do you see instead?
Client should stay connected, and the socket/fd on both end stays open, but the 
connection is 
lost in the middle when the loadbalancer thinks the connection is no longer 
active or alive.

Instead I see the loadbalancer dropping the connection. Our setup uses TCP 
tunneling, so the 
breaking of the connection is not detected by either end of the connection, and 
particularly on the 
server-side, the amount of file descriptors open keeps rising. Having a client 
connection timeout 
set in the redis.conf is a workaround, but does not fix the issue.

What version of the product are you using? On what operating system?

1.2.6 - current stable

Please provide any additional information below.

I have a patch to add a configuration option to set proper TCP keepalive 
options on all client 
connections: http://github.com/trickie/redis/

Original issue reported on code.google.com by tric...@gmail.com on 6 Apr 2010 at 10:59

GoogleCodeExporter commented 9 years ago
My patch (at least on Linux) adds an option to specify the interval in which to 
start sending probes, the same 
interval between probes, and will also break the connection when a probes 
reveals a broken connection

Original comment by tric...@gmail.com on 6 Apr 2010 at 11:03

GoogleCodeExporter commented 9 years ago
The patch in the git tree doesn't quite apply on 1.2.6. Attached to this ticket 
is a patch for 1.2.6 that is combined 
with my replication sync patch from 203. 

Original comment by tric...@gmail.com on 6 Apr 2010 at 11:17

Attachments: