【问题标题】:Azure Redis Timeouts in NET APINET API 中的 Azure Redis 超时
【发布时间】:2020-06-22 06:52:11
【问题描述】:

我有 asp net v4.6.1 和 StackExchange.Redis v2.0.61 并且由于 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) 

Azure 统计数据:

内存 105MO~ / CPU : 0%~25%

谢谢;

【问题讨论】:

    标签: asp.net azure redis stackexchange.redis


    【解决方案1】:

    您似乎在客户端计算机上遇到请求/响应的备份,这会导致后面的请求超时。这可能是由于线程不足或响应处理逻辑昂贵。

    在所有三个例外中,WORKER 部分显示的线程数大于 .NET 在ThreadPool 中保留的Min 数。您应该调整ThreadPool 设置以增加最小计数或了解如何减少客户端中的工作线程数,使其少于Min

    在两个例外中,in: number 显示大于 0 的number。这表明响应流中有字节等待您的客户端应用程序读取。这可能是由于客户端应用程序发送请求的速度快于处理其响应的速度。缓慢的响应处理通常表明正在使用响应值执行昂贵的逻辑,尽管由于线程不足,这可能会进一步减慢。

    https://stackexchange.github.io/StackExchange.Redis/Timeouts
    https://docs.microsoft.com/azure/azure-cache-for-redis/cache-troubleshoot-client#traffic-burst

    【讨论】:

    • 感谢您的回复,与WORKER有关,我们之前尝试过调整值并增加SetMinThreads(250,250)的worker数,这导致服务器每天突然宕机多次,并且对于官方文档"For instance, using pipelining Redis running on an average Linux system can deliver even 1 million requests per second" 中的数字我真的很困惑,我认为Redis 可以接受拥抱请求的数量! (我用一些天蓝色的统计数据更新了问题)
    • 在调查更多时,我发现 redis 支持直到 16DB,在我当前的项目中,我只使用第一个,如果我使用其他项目,这是否可以减少超时异常?
    猜你喜欢
    • 1970-01-01
    • 2021-01-11
    • 2017-05-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-09
    • 2022-01-07
    • 2016-12-03
    相关资源
    最近更新 更多