您的位置:首页 > 文旅 > 美景 > redis server response timeout(3000ms) occurred after 3 retry attempts异常分析

redis server response timeout(3000ms) occurred after 3 retry attempts异常分析

2024/10/6 18:25:27 来源:https://blog.csdn.net/weixin_43811057/article/details/140533390  浏览:    关键词:redis server response timeout(3000ms) occurred after 3 retry attempts异常分析

读取redis数据报超时错误:

 Redis server response timeout (3000 ms) occured after 3 retry attempts

在这里插入图片描述

2024-07-18 17:07:57.124 ERROR [e8f07b0a671c08311dff589827897232] [http-nio-9528-exec-6] c.z.i.u.m.c.e.BaspUserExceptionHandler.exceptionHandler:83 - RuntimeException:java.util.concurrent.ExecutionException: org.springframework.dao.QueryTimeoutException:Redis server response timeout (3000 ms) occured after 3 retry attempts, is non-idempotent command: false Check connection with Redis node:  for TCP packet drops.  Try to increase nettyThreads and/or timeout settings. Command: (LRANGE), params: [[118, 111, 108, 116, 101, 58, 111, 114, 103, 58, ...], 0, -1], channel: [];nested exception is org.redisson.client.RedisResponseTimeoutException: Redis server response timeout (3000 ms) occured after 3 retry attempts, is non-idempotent command: false Check connection with Redis node:  for TCP packet drops.  Try to increase nettyThreads and/or timeout settings. Command: 

问题排查

  • 根据报错后的提示,将客户端超时时间改大一些。
  • 通过异常分析,发现出现异常的地方为set操作,一分析,是value值过大,导致超时。

在这里插入图片描述

  • 确认问题发生时的操作,若为执行操作时Key值过大,也会造成超时报错。一般建议key不要超过10KB。
    单key大小,Redis限制每个String类型value大小不超过512MB,
    实际开发中,不要超过10KB,否则会对CPU和网卡造成极大负载。
    hash、list、set、zset元素个数不要超过5000。
    理论上限: 每个hashset里元素数量< 2^32。

根据报错后的提示,将客户端参数PingConnectionInterval调大试试。

查看redisson配置,调大参数PingConnectionInterval
在这里插入图片描述

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com