pub/sub does not keepalive

808 views
Skip to first unread message

luo

unread,
Dec 30, 2011, 5:05:58 AM12/30/11
to Redis DB
I have one client subscribe to one channel. After a certain period of
time about 10 minutes idle, the client can not receive any message,
but the publish command still returns 1. I've tried redis-py and
servicestack.redis clients. The only difference is seems the idle
period can be little longer when use servicestack.redis.

Any idea? Thanks in advance.

Dvir Volk

unread,
Dec 30, 2011, 9:28:21 AM12/30/11
to redi...@googlegroups.com
this seems like a TCP issue, are you going through some load balancer or other proxy device?



--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.




--
Dvir Volk
System Architect, DoAT, http://doat.com

luo

unread,
Dec 30, 2011, 11:04:39 PM12/30/11
to Redis DB
the client and the server are in two LANs. No load balancer or proxy
between them. I've just tried to connect them in a same LAN,it works
perfectly. Probably there are something configured on the routers. Our
administrator is on holiday. I will figure it out after New Year's
holiday. Thank you.

Dvir Volk

unread,
Dec 31, 2011, 5:15:57 AM12/31/11
to redi...@googlegroups.com
an ugly bypass would be to avoid this TCP idle timeout by sending mock messages periodically, and having the client ignore them

Will P

unread,
Jan 1, 2012, 11:31:25 AM1/1/12
to Redis DB

I'd bet that there is NAT or stateful firewall in the router that is
connecting the two LANs, with an idle connection timeout configured,
or which periodically overflows its connection table and drops the
oldest connections. I've seen this happen with a pub/sub application
(not redis) over WAN connections on a quirky network and worked around
it by setting TCP keepalive on the socket connection at the client
side, and then later added it to the server (not redis) for good
measure.

I wonder what is the output of "INFO clients" on the redis server,
after this happens?
Reply all
Reply to author
Forward
0 new messages