题
我使用用PHP redis的(predis在 http://github.com/nrk/predis/ )和我经常遇到超时。堆栈跟踪所示:
[04-Apr-2010 03:39:50] PHP Fatal error: Uncaught exception 'Predis_ClientException' with message 'Connection timed out' in redis.php:697
Stack trace:
#0 redis.php(757): Predis_Connection->connect()
#1 redis.php(729): Predis_Connection->getSocket()
#2 redis.php(825): Predis_Connection->writeCommand(Object(Predis_Commands_ListRange))
#3 redis.php(165): Predis_ConnectionCluster->writeCommand(Object(Predis_Commands_ListRange))
#4 redis.php(173): Predis_Client->executeCommandInternal(Object(Predis_ConnectionCluster), Object(Predis_Commands_ListRange))
#5 redis.php(157): Predis_Client->executeCommand(Object(Predis_Commands_ListRange))
#6 [internal function]: Predis_Client->__call('lrange', Array)
这情况持续,我不知道为什么。任何人有任何想法?
解决方案
我认为这是因为空闲连接得到由Redis的默认关闭的。
redis.conf
# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0
其他提示
有一个未确定上错误的 Redis的问题列表,尝试更新的Redis到最新版本,看看问题是否仍然存在。
不隶属于 StackOverflow