문제

I have Twisted server with constant connection to Redis. I'm using library https://github.com/fiorix/txredisapi.

Problem is that from time to time Twisted lose connection to Redis and reconnects shortly after. I have no idea why. Same thing is happening both on my local machine and on my online VPS.

Log:

2013-04-12 11:25:34+0200 [RedisProtocol,client] <twisted.internet.tcp.Connector instance at 0xf6c45d4c> will retry in 10 seconds
2013-04-12 11:25:34+0200 [RedisProtocol,client] Stopping factory <lib.txredisapi.txredisapi.RedisFactory instance at 0xf6c45ccc>
2013-04-12 11:25:45+0200 [-] Starting factory <lib.txredisapi.txredisapi.RedisFactory instance at 0xf6c45ccc>
2013-04-12 11:30:47+0200 [RedisProtocol,client] <twisted.internet.tcp.Connector instance at 0xf6c45d4c> will retry in 10 seconds
2013-04-12 11:30:47+0200 [RedisProtocol,client] Stopping factory <lib.txredisapi.txredisapi.RedisFactory instance at 0xf6c45ccc>
2013-04-12 11:30:58+0200 [-] Starting factory <lib.txredisapi.txredisapi.RedisFactory instance at 0xf6c45ccc>
2013-04-12 11:35:59+0200 [RedisProtocol,client] <twisted.internet.tcp.Connector instance at 0xf6c45d4c> will retry in 10 seconds
2013-04-12 11:35:59+0200 [RedisProtocol,client] Stopping factory <lib.txredisapi.txredisapi.RedisFactory instance at 0xf6c45ccc>
2013-04-12 11:36:10+0200 [-] Starting factory <lib.txredisapi.txredisapi.RedisFactory instance at 0xf6c45ccc>
2013-04-12 11:41:12+0200 [RedisProtocol,client] <twisted.internet.tcp.Connector instance at 0xf6c45d4c> will retry in 8 seconds
2013-04-12 11:41:12+0200 [RedisProtocol,client] Stopping factory <lib.txredisapi.txredisapi.RedisFactory instance at 0xf6c45ccc>
2013-04-12 11:41:21+0200 [-] Starting factory <lib.txredisapi.txredisapi.RedisFactory instance at 0xf6c45ccc>

It happens all day and all night, my logs are getting big quickly.

Log when someone connects while redis is disconnected:

2013-04-12 12:29:58+0200 [HTTPPageGetter,client] Unhandled error in Deferred:
2013-04-12 12:29:58+0200 [HTTPPageGetter,client] Unhandled Error
Traceback (most recent call last):
Failure: lib.txredisapi.txredisapi.ConnectionError: Not connected
2013-04-12 12:30:03+0200 [-] Starting factory <lib.txredisapi.txredisapi.RedisFactory instance at 0xf6c45ccc>
2013-04-12 12:30:22+0200 [Protocol,20,89.73.182.51] Connection from 89.73.182.51:38635 closed. Code: 1006, Reason: connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)
도움이 되었습니까?

해결책

Ok, I got answer from creator of txredisapi. In config there is timeout setting which by default is set to 300 seconds. So simple.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top