c# - 即使增加超时后,stackexchange.redis 也会抛出超时?

标签 c# redis stackexchange.redis

尝试从缓存中删除时出现以下错误:

执行 DEL test.com 超时,inst: 0, mgr: ExecuteSelect, err: never,queue: 0, qu: 0, qs: 0, qc: 0, wr: 0, wq: 0, in :0,ar:0,clientName:ORLWS052,serverEndpoint:未指定/pub-redis-16778.us-west-2-1.1.ec2.garantiadata.com:16778,keyHashSlot:6928,IOCP:(忙= 3,空闲= 997,Min=4,Max=1000), WORKER: (Busy=4,Free=4091,Min=4,Max=4095), Local-CPU: 100% (一些常见的客户端请看这篇文章-可能导致超时的副作用:https://github.com/StackExchange/StackExchange.Redis/tree/master/Docs/Timeouts.md)

更新时我也遇到类似的超时。

我不知道如何阅读这篇文章,所以如果有人知道的话会很有帮助。

我尝试更新或删除的 key 大小为 5515 字节。

我还运行了slowlog get命令,但没有(长度为0)

我也尝试过增加超时时间,但这也不起作用

最佳答案

IOCP: (Busy=3,Free=997,Min=4,Max=1000), WORKER: (Busy=4,Free=4091,Min=4,Max=4095), 本地CPU: 100%

请检查您的 ICOP、WORKER 繁忙线程和最小线程。 CPU 利用率也为 100%。 timeoutHelpLink 在最新版本中已更新。

https://stackexchange.github.io/StackExchange.Redis/Timeouts

If we look at an example error message from StackExchange.Redis (build 1.0.450 or later), you will see that it now prints ThreadPool statistics (see IOCP and WORKER details below).

System.TimeoutException: Timeout performing GET MyKey, inst: 2, mgr: Inactive, queue: 6, qu: 0, qs: 6, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, IOCP: (Busy=6,Free=994,Min=4,Max=1000), WORKER: (Busy=3,Free=997,Min=4,Max=1000)

In the above example, you can see that for IOCP thread there are 6 busy threads and the system is configured to allow 4 minimum threads. In this case, the client would have likely seen two 500 ms delays because 6 > 4.

Note that StackExchange.Redis can hit timeouts if growth of either IOCP or WORKER threads gets throttled.

Recommendation: Given the above information, it's recommend to set the minimum configuration value for IOCP and WORKER threads to something larger than the default value. We can't give one-size-fits-all guidance on what this value should be because the right value for one application will be too high/low for another application. This setting can also impact the performance of other parts of complicated applications, so you need to fine-tune this setting to your specific needs. A good starting place is 200 or 300, then test and tweak as needed.

关于c# - 即使增加超时后,stackexchange.redis 也会抛出超时?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44114824/

相关文章:

c# - 打印页面而不显示它?

c# - 解析 LuisResult 以获取值字段

mysql - Redis作为MySQL引擎?

c# - stackexchange redis缓存性能

redis - 如何一次性获取Redis数据库中的键值列表?

c# - CollectionViewSource 初始化引发列表框的 SelectionChanged

c# - 无法解析 ASP.Net Core 中类型“ServiceStack.Redis.Generic.IRedisTypedClient”的服务

javascript - 在redis中存储node.js setTimeout的返回值

.net-core - 如何使用 StackExchange.Redis 使多个操作原子化

c# - 正则表达式选择单词的一部分