从服务器读取行时 Predis 错误,超时修复

Predis Error while reading line from server , timeout fix

我将 Redis 与守护进程以及常规缓存一起使用

timeout=300 目前在我的 redis.conf 文件中

有人建议在几个 Git 链接处将其更改为 timeout=0 (https://github.com/predis/predis/issues/33)

我担心的是,如果我将超时设置为 0,redis 服务器将不会断开任何连接

一段时间后,我发现有可能出现 max number of clients reached

的错误

求教修改超时时间 --> 0 at redis.conf


目前,我经常收到以下错误日志(每 2-3 分钟)[timeout=300]

{"message":"Error while reading line from the server. [tcp://10.10.101.237:6379]","context":
{"exception":{"class":"Predis\Connection\ConnectionException","message":"Error while reading 
line from the server. 
[tcp://10.10.101.237:6379]","code":0,"file":"/var/www/api/vendor/predis/predis/src/Connection/Ab
stractConnection.php:155"}},"level":400,"level_name":"ERROR","channel":"production","datetime":
{"date":"2020-09-23 07:14:01.207506","timezone_type":3,"timezone":"Asia/Kolkata"},"extra":[]}

我改成了timeout = 0

一切正常!!!

PS:发帖,post改后2个月的观察