记录一次.net core使用redis报错

一、记录一次报错:报错信息如下

RedisTimeoutException: Timeout awaiting response (outbound=0KiB, inbound=1KiB, 12063ms elapsed, timeout is 1000ms), command=SCAN, next: SCAN, inst: 0, qu: 0, qs: 1, aw: False, bw: Inactive, rs: DequeueResult, ws: Idle, in: 0, in-pipe: 3713, out-pipe: 0, last-in: 0, cur-in: 5078, sync-ops: 0, async-ops: 2, serverEndpoint: 106.54.75.72:6379, conn-sec: 24.62, aoc: 1, mc: 1/1/0, mgr: 9 of 10 available, clientName: ZHCX-DEV35(SE.Redis-v2.6.122.38350), IOCP: (Busy=0,Free=1000,Min=6,Max=1000), WORKER: (Busy=2,Free=32765,Min=6,Max=32767), POOL: (Threads=9,QueuedItems=0,CompletedItems=137,Timers=4), v: 2.6.122.38350 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)

.net core 使用redis报错RedisTimeoutException: Timeout awaiting response (outbound=0KiB, inbound=1KiB, 12063ms elapsed, timeout is 1000ms), command=SCAN, next: SCAN, inst: 0, qu: 0, qs: 1, aw: False, bw: Inactive, rs: DequeueResult, ws: Idle, in: 0, in-pipe: 3713, out-pipe: 0, last-in: 0, cur-in: 5078, sync-ops: 0, async-ops: 2, serverEndpoint: 106.54.75.72:6379, conn-sec: 24.62, aoc: 1, mc: 1/1/0, mgr: 9 of 10 available, clientName: ZHCX-DEV35(SE.Redis-v2.6.122.38350), IOCP: (Busy=0,Free=1000,Min=6,Max=1000), WORKER: (Busy=2,Free=32765,Min=6,Max=32767), POOL: (Threads=9,QueuedItems=0,CompletedItems=137,Timers=4), v: 2.6.122.38350 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)

解决方法:

public class Program
    {
        public static void Main(string[] args)
        {
            System.Threading.ThreadPool.SetMinThreads(200, 200); //设置全局线程池
            CreateHostBuilder(args).Build().Run();
        }
}

设置全局线程池就可以了。

 

posted @   锦大大的博客呀!  阅读(154)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示