SETNX Timeout with StackExchange.Redis

0

Caught this random exception in the wild:

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.TimeoutException: Timeout performing SETNX GeoIP.[REDACTED], inst: 1, mgr: Inactive, err: never, queue: 2, qu: 0, qs: 2, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, clientName: PRD-VM-WEB-1, serverEndpoint: Unspecified/[REDACTED].redis.cache.windows.net:6380, keyHashSlot: 3519, IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=1,Free=32766,Min=2,Max=32767), Local-CPU: unavailable (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, ResultProcessor1 processor, ServerEndPoint server) at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor1 processor, ServerEndPoint server)

Using StackExchange.Redis, deployed on Azure.

From what I can tell from the referenced cached document it looks fine, perhaps the Local-CPU unavailable value is the problem?

Does anyone know what might of caused this to throw?

redis
timeout
stackexchange.redis
asked on Stack Overflow Apr 8, 2017 by Tom Gullen

2 Answers

0

When you look at the errors you are receiving, do you see any Timeout errors where the BUSY value is greater than the MIN for the IOCP or Worker threadpool? If so, threadpool throttling can be the cause. This often happens under bursty scenarios. This is often accompanied by high CPU, which can also cause timeouts. Threadpool throttling is explained here: https://gist.github.com/JonCole/e65411214030f0d823cb#file-threadpool-md.

Also, here are some best practices: https://gist.github.com/JonCole/925630df72be1351b21440625ff2671f#best-practices-for-azure-redis

answered on Stack Overflow Apr 9, 2017 by Carl Dacosta
0

Example

SET key value EX timeout NX

SET hello world EX 100 NX
answered on Stack Overflow Jan 7, 2019 by g10guang

User contributions licensed under CC BY-SA 3.0