Stackexchange.Redis timeout exception in .net-core

I am transferring clean library 4 to net-core 1.0.0-preview 2

It uses Stackexchange.Redis version 1.2.1 when developing my network library and 1.2.0 for net 4 version.

In net 4, my library was never broken when calling Redis commands.

In net-core, I get this error randomly:

 System.TimeoutException: Timeout performing GET netkey, inst: 6, queue: 10, qu: 0, qs: 10, qc: 0, wr: 0, wq: 0, in: 645, ar: 0, clientName: XXXXXX, serverEndpoint: Unspecified/XXXXXXX, keyHashSlot: XXXXX(Please take a look at this article for some common client-side issues that can cause timeouts: https://github.com/StackExchange/StackExchange.Redis/tree/master/Docs/Timeouts.md)
   at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server)
   at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server)
   at StackExchange.Redis.RedisDatabase.StringGet(RedisKey key, CommandFlags flags)

UPDATE I use default configurations (connection timeout, reconnection, etc.)

UPDATE Added keep-alive configuration but still not done

Any ideas?

+4
source share
3 answers

: ​​ SyncTimeout 10000. 5000 , 10000 . - 1000.

+2

? ( : .Net Core Project, 100% , .)

Application_Start Global.asax.cs

private static int THREAD_MIN = 50; // 4 cores in production = 200
...                
//Per Redis docs, upping the number of threads available to handle the IO demands on the cloud.   
//https://github.com/StackExchange/StackExchange.Redis/blob/master/Docs/Timeouts.md 
ThreadPool.SetMinThreads(THREAD_MIN, THREAD_MIN);       
0

SyncTimeout , redis - - .net-core threadpool .

maxThreads .

:

ComPlus_ThreadPool_ForceMaxWorkerThreads 1000 ComPlus_ThreadPool_ForceMinWorkerThreads 50

( )

0

Source: https://habr.com/ru/post/1672937/


All Articles