[英]Redisson client ; RedisTimeoutException issue
I am using Google cloud managed redis cluster(v5)
via redisson(3.12.5)
我正在通过redisson(3.12.5)
使用Google cloud managed redis cluster(v5)
)
Following are my SingleServer
configurations in yaml file以下是我在 yaml 文件中的SingleServer
配置
singleServerConfig:
idleConnectionTimeout: 10000
connectTimeout: 10000
timeout: 3000
retryAttempts: 3
retryInterval: 1500
password: null
subscriptionsPerConnection: 5
clientName: null
address: "redis://127.0.0.1:6379"
subscriptionConnectionMinimumIdleSize: 1
subscriptionConnectionPoolSize: 50
connectionMinimumIdleSize: 40
connectionPoolSize: 250
database: 0
dnsMonitoringInterval: 5000
threads: 0
nettyThreads: 0
codec: !<org.redisson.codec.JsonJacksonCodec> {}
I am getting following exceptions when I increase the load on my application当我增加应用程序的负载时出现以下异常
org.redisson.client.RedisTimeoutException: Unable to acquire connection! Increase connection pool size and/or retryInterval settings Node source: NodeSource
org.redisson.client.RedisTimeoutException: Command still hasn't been written into connection! Increase nettyThreads and/or retryInterval settings. Payload size in bytes: 34. Node source: NodeSource
It seems there is no issue on redis cluster and i think i need to make tweaking in my client side redis connection pooling confs(mentioned above) to make it work. redis 集群似乎没有问题,我认为我需要在客户端 redis 连接池配置(如上所述)中进行调整以使其工作。
Please suggest me the changes i need to make in my confs请建议我需要在我的 confs 中进行的更改
I am also curious if I should close the Redis
connection after making get/set calls.我也很好奇是否应该在进行 get/set 调用后关闭Redis
连接。 I have tried finding this but found nothing conclusive on how to close Redis
connections我试过找到这个,但没有发现关于如何关闭Redis
连接的结论
One last thing that I want to ask is that is there any mechanism to get Redis
connection pool stats(active connection, idle connection etc ) in Redisson
我想问的最后一件事是,是否有任何机制可以在Redisson
中获取Redis
连接池统计信息(活动连接、空闲连接等)
Edit1:编辑1:
I have tried by changing values following values in 3 different iterations我已经尝试通过在 3 次不同的迭代中更改以下值
Iteration 1:迭代 1:
idleConnectionTimeout: 30000
connectTimeout: 30000
timeout: 30000
Iteration 2:迭代 2:
nettyThreads: 0
Iteration 3:迭代 3:
connectionMinimumIdleSize: 100
connectionPoolSize: 750
I have tried these things but nothing has worked for me我已经尝试过这些东西,但没有任何东西对我有用
Any help is appreciated.任何帮助表示赞赏。
Thanks in advance提前致谢
Assuming you are getting low memory alerts on your cache JVM.假设您在缓存 JVM 上收到低 memory 警报。
You may have to analyze the traffic and determine 2 things您可能需要分析流量并确定两件事
Both can be determined by the traffic on your server.两者都可以由服务器上的流量决定。
For option 1 configuring pool-size would solve you issue, but for option 2 you may have to refactor your code to persist data in smaller chunks.对于选项 1,配置池大小可以解决您的问题,但对于选项 2,您可能必须重构代码以将数据保存在较小的块中。
Try to set nettyThreads = 64
settings尝试设置nettyThreads = 64
设置
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.