StackExchange.Redis.RedisTimeoutException occuring Frequently

2.9k Views Asked by At

we are using Elastic cache redis that aws provides in our .Net Core application and when we perform the below operation sometimes we are getting the below TimeoutException after sometime can someone please help me to solve this attaching exception for reference

_redis.KeyExists("cusID"+customerID) -> operation performed

Exception has occurred: CLR/StackExchange.Redis.RedisTimeoutException Exception thrown: 'StackExchange.Redis.RedisTimeoutException' in StackExchange.Redis.dll: 'Timeout performing EXISTS (5000ms), next: EXISTS cusID1, inst: 0, qu: 0, qs: 0, aw: False, bw: SpinningDown, rs: ReadAsync, ws: Idle, in: 0, serverEndpoint: master.test-stage-test-new-jayaram3.mvg9d6.aps1.cache.amazonaws.com:6379, mc: 1/1/0, mgr: 10 of 10 available, clientName: JAYA-397(SE.Redis-v2.5.61.22961), IOCP: (Busy=0,Free=10000,Min=10000,Max=10000), WORKER: (Busy=2,Free=32765,Min=10000,Max=32767), POOL: (Threads=13,QueuedItems=0,CompletedItems=790), v: 2.5.61.22961 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)' at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor1 processor, ServerEndPoint server) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1857 at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor1 processor, ServerEndPoint server) in //src/StackExchange.Redis/RedisBase.cs:line 53 at StackExchange.Redis.RedisDatabase.KeyExists(RedisKey key, CommandFlags flags) in //src/StackExchange.Redis/RedisDatabase.cs:line 667

An exception of type 'StackExchange.Redis.RedisTimeoutException' occurred in StackExchange.Redis.dll but was not handled in user code: 'Timeout performing GET (5000ms), active: GET cusID1, next: GET cusID1 ** possible thread-theft indicated; see https://stackexchange.github.io/StackExchange.Redis/ThreadTheft ** , inst: 1, qu: 0, qs: 0, aw: False, bw: SpinningDown, rs: CompletePendingMessageSync, ws: Idle, in: 0, serverEndpoint: master.suremdm-stage-test-new-jayaram3.mvg9d5.aps1.cache.amazonaws.com:6379, mc: 1/1/0, mgr: 8 of 10 available, clientName: JAYA-397(SE.Redis-v2.5.61.22961), IOCP: (Busy=3,Free=9997,Min=10000,Max=10000), WORKER: (Busy=5,Free=32762,Min=10000,Max=32767), POOL: (Threads=12,QueuedItems=0,CompletedItems=2634), v: 2.5.61.22961 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)'

If need some more information, just ask me that I'll try to provide. Thanks in advance.

1

There are 1 best solutions below

3
On

Are you setting "AbortOnConnectFail" to false so it continues to try to reconnect? When a connection breaks (could be due to a failover etc), commands already sent to Redis on the now broken connection will timeout on the client.