StackExchange.Redis GET Timeouts

I ran into a timeout problem when using StackExchange.Redis. Everything I could find in stackoverflow I tried.

Here is what I get: Timeout performing GET XXX, inst: 4, mgr: ProcessReadQueue, err: never, queue: 9, qu: 0, qs: 9, qc: 0, wr: 0, wq: 0, in: 65536, ar: 1, IOCP: (Busy=0,Free=1000,Min=400,Max=1000), WORKER: (Busy=35,Free=32732,Min=400,Max=32767)

In almost all the exceptions that I receive only queueand qs, they change, and it matters before 11.

I am using the nuget version 1.0.488. The application is hosted on IIS 8.5 on Windows Server 2012. On this machine we have 32 GB of RAM, and it is used from 30-50%. I installed maxmemoryin 16gband maxheapat 22gb. Saving to disk is disabled. I use it only as a session repository.

The Redis server (version x64-2.8.2402) is installed on the same computer. Here is the redis-cli info url that I have.

This is also part of the exception that I get:

System.TimeoutException: Timeout performing GET Airports, inst: 1, mgr: ProcessReadQueue, err: never, queue: 4, qu: 0, qs: 4, qc: 0, wr: 0, wq: 0, in: 65536, ar: 1, IOCP: (Busy=0,Free=1000,Min=400,Max=1000), WORKER: (Busy=20,Free=32747,Min=400,Max=32767), clientName: OWNEROR-G875DJG   at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line 1927    at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\RedisBase.cs:line 80    at StackExchange.Redis.RedisDatabase.StringGet(RedisKey key, CommandFlags flags) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\RedisDatabase.cs:line 1451    at Resvoyage.Services.RedisCacheProvider.GetValue[T](String key) in c:\Development\thomalex\resvoyage\Resvoyage.Services\RedisCacheProvider.cs:line 88 

This is what the connection string looks like <add key="LocalRedis" value="127.0.0.1:6379,connectTimeout=25000,allowAdmin=true,password=xxx" />. ConnectionTimeout was 15000, and I tried to include it in25000

I also increased minIoThreadin machine.configfor IIS. Here are the values ​​I posted<processModel autoConfig="true" minIoThreads="50" minWorkerThreads="50" maxWorkerThreads = "100" maxIoThreads = "100"/>

+4
source share
1 answer

Read slowis slowlog to see if there are slow requests in redis. Maybe you are using a key command? Redis is single-threaded, so a single slow request can block everything, and since the client will not wait for redis forever, you run into timeouts.

+3
source

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


All Articles