记录一次.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 @ 2023-07-16 21:12  锦大大的博客呀!  阅读(123)  评论(0编辑  收藏  举报