报错日志
org.redisson.client.RedisTimeoutException: Unable to send command! Try to increase 'nettyThreads' and/or connection pool size settings Node source: NodeSource [slot=0, addr=null, redisClient=null, redirect=null, entry=MasterSlaveEntry [masterEntry=[freeSubscribeConnectionsAmount=1, freeSubscribeConnectionsCounter=value:50:queue:0, freeConnectionsAmount=23, freeConnectionsCounter=value:199:queue:0, freezed=false, freezeReason=null, client=[addr=redis:// :6379], nodeType=MASTER, firstFail=0]]], connection: RedisConnection@720278180 [redisClient=[addr=redis:// :6379], channel=[id: 0x298b7cd4, L:/ :53666 - R: / :6379], currentCommand=CommandData [promise=RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@6bd3989f(failure: java.util.concurrent.CancellationException)], command=(LRANGE), params=[HOTEL_OPERATION_PLATFORM_COUPON_V1_KEY_CARDBINDING_COUPON_LIST_368, 0, -1], codec=org.redisson.codec.FstCodec]], command: (DEL), params: [HOTEL_OPERATION_PLATFORM_COUPON_V1_KEY_SYNC_USER_COUPON_LIST_MC1687944310642224681_4448055] after 3 retry attempts
at org.redisson.command.CommandAsyncService$6.run(CommandAsyncService.java:715)
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:682)
at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:757)
at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:485)
at java.lang.Thread.run(Thread.java:750)
解决
增加 nettyThreads:如果你使用的是 Lettuce 作为 Redis 客户端,nettyThreads 是用来处理 I/O 操作的线程数量。如果默认值不足以处理你的请求负载,你可能需要增加这个值。你可以在客户端配置中设置这个参数
修改配置
spring.redis.pool.max-active = 1500
spring.redis.pool.max-idle = 800
spring.redis.pool.min-idle = 500
spring.redisson.netty.thread = 400
#主要是新增加这个配置,参数值可以根据实际业务调整
重启服务生效,观察几天,日志不再报错。