炫意html5
最早CSS3和HTML5移动技术网站之一

.net core 3.1 使用StackExchange.Redis 高并发下timeout超时问题如何解决?

StackExchange.Redis 在压测下频繁超时,按照网上的解决方案设置.ThreadPool.SetMinThreads也不起作用,请教大佬们有何解决方案;
Timeout awaiting response (outbound=0KiB, inbound=0KiB, 5981ms elapsed, timeout is 5000ms), command=HMGET, next: HMGET xxxxxxxxx:access:ccbbe50309060380bd37f96551b75ae6,
inst: 0, qu: 0, qs: 7, aw: False, rs: ReadAsync, ws: Idle, in: 4036, in-pipe: 0, out-pipe: 0, serverEndpoint: 112.12.15.12:6379,
mc: 1/1/0,
mgr: 10 of 10 available,
clientName: localhost,
IOCP: (Busy=0,Free=1000,Min=8,Max=1000),
WORKER: (Busy=58,Free=32709,Min=8,Max=32767),
v: 2.1.58.34321 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)
StackExchange.Redis.RedisTimeoutException: Timeout awaiting response (outbound=0KiB, inbound=0KiB, 5981ms elapsed, timeout is 5000ms), command=HMGET, next: HMGET StarPraise.User.Service.UserAccount.Tokens.TokenProvider:TokenData:access:ccbbe50309060380bd37f96551b75ae6, inst: 0, qu: 0, qs: 7, aw: False, rs: ReadAsync, ws: Idle, in: 4036, in-pipe: 0, out-pipe: 0, serverEndpoint: 172.22.25.32:6379, mc: 1/1/0, mgr: 10 of 10 available, clientName: localhost, IOCP: (Busy=0,Free=1000,Min=8,Max=1000), WORKER: (Busy=58,Free=32709,Min=8,Max=32767), v: 2.1.58.34321 (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 static void Main(string[] args)
        {
            #if !DEBUG
            //为了解决redis 超时的问题,设置最小线程数量
            //https://gist.github.com/JonCole/e65411214030f0d823cb
            ThreadPool.SetMinThreads(250, 250);
            #endif
            CreateHostBuilder(args).Build().Run();
        }

炫意HTML5 » .net core 3.1 使用StackExchange.Redis 高并发下timeout超时问题如何解决?

Java基础教程Android基础教程