redis 与 predis 超时

发布于 2024-08-27 11:46:02 字数 939 浏览 2 评论 0原文

我正在将 redis 与 php 结合使用(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)

这种情况持续发生,我不知道为什么。有人有什么想法吗?

I'm using redis with php (predis at http://github.com/nrk/predis/) and am experiencing frequent timeout. The stack trace shows:

[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)

This happens consistently and I have no idea why. Anyone has any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

场罚期间 2024-09-03 11:46:02

我认为这是因为 Redis 默认关闭空闲连接。

redis.conf

# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0

I think this is because of idle connections are getting closed by default by Redis.

redis.conf

# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0
呆橘 2024-09-03 11:46:02

Redis 问题列表中存在未经确认的错误,尝试将Redis更新到最新版本,看看问题是否仍然存在。

There is an unconfirmed bug on the Redis Issues List, try updating Redis to the most current version and see if the problem persists.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文