asp.net - NET API 中的 Azure Redis 超时
问题描述
我有带有 StackExchange.Redis v2.0.61 的 asp net v4.6.1 并且由于 redis 的实施,我总是随机出现相同的错误,如果有人可以提供帮助,这里是一些错误日志,我关注了官方文档/微软论坛提供有助于减少错误数量和更改线程池的步骤。
Timeout performing GET (2000ms), next: GET key, inst: 0, qu: 0, qs: 9, aw: False, rs: ReadAsync, ws: Idle, in: 0, serverEndpoint: Unspecified/{myserver}:6380, mgr: 10 of 10 available, clientName: {myclient}, IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER: (Busy=38,Free=8153,Min=4,Max=8191), v: 2.0.601.3402 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)
.
Timeout performing GET (2000ms), next: GET key1, inst: 1, qu: 0, qs: 6, aw: False, rs: ReadAsync, ws: Idle, in: 34344, serverEndpoint: Unspecified/{myserver}:6380, mgr: 10 of 10 available, clientName: {myclient}, IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER: (Busy=39,Free=8152,Min=4,Max=8191), v: 2.0.601.3402 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)
.
Timeout performing GET (2000ms), next: GET key2, inst: 12, qu: 0, qs: 10, aw: False, rs: ReadAsync, ws: Idle, in: 10159, serverEndpoint: Unspecified/{myserver}:6380, mgr: 10 of 10 available, clientName: {myclient}, IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER: (Busy=25,Free=8166,Min=4,Max=8191), v: 2.0.601.3402 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)
蔚蓝统计:
内存 105MO~ / CPU : 0%~25%
谢谢 ;
解决方案
看起来您正在客户端计算机上遇到请求/响应的备份,这会导致以后的请求超时。这可能是由于线程不足或由于昂贵的响应处理逻辑。
在所有三个例外中,这些WORKER
部分显示的Busy
线程数大于Min
.NET 在 .NET 中保留的计数ThreadPool
。您应该调整ThreadPool
设置以增加最小计数或了解如何减少客户端中的工作线程数,使其少于Min
在两个异常中,in: number
显示number
大于 0。这表明响应流中有字节,等待您的客户端应用程序读取。这可能是由于客户端应用程序发送请求的速度快于处理其响应的速度。缓慢的响应处理通常表明正在使用响应值执行昂贵的逻辑,尽管由于线程不足,这可能会进一步减慢。
https://stackexchange.github.io/StackExchange.Redis/Timeouts
https://docs.microsoft.com/azure/azure-cache-for-redis/cache-troubleshoot-client#traffic-burst
推荐阅读
- linux - JUnit 测试套件在 docker 容器中执行时挂起
- python - random.sample(sample,k) 和 itertools.combinations(p,r) 之间的区别
- spring - 在@Bean 定义中使用@Qualifier 的用例是什么?
- c# - 如何在 C# 中反序列化带有属性的 XML
- c# - 用鼠标控制的定位相机问题,以便玩家保持在视野中(第三人称视角)
- ruby - Homebrew 不再工作了。“i18n gem 不可用”
- reactjs - ReactJs:在实现了 React 和 Redux 之间的链接的根组件中访问状态数据的正确方法是什么?
- python - 从屏幕流式传输帧,生成视频
- android - 如何使用导航组件处理片段中的片段?
- python - 嵌套函数通过python中的外部函数返回一个变量