I’m using Redlock.Net with StackExchange Redis 2.8.0, and I’m getting some huge delays (randomly every few seconds), trying to aqcuire a lock. Locks are basically SET/EVAL commands, and both go from 0ms to 900ms sometimes. I’m looking for some insight on what could be the cause of this latency.
After adding some tracing, I got to the Stackechange.Redis taking all the time time of the delay. Requests are sent quickly and take 1s to get the response back.
This is a regular request for reference:
Redis-benchmark gives me low larency consistently:
$ redis-benchmark -t get
...
throughput summary: 138696.25 requests per second
latency summary (msec):
avg min p50 p95 p99 max
0.214 0.056 0.175 0.351 1.047 6.887
And the latency between nodes is sub millisecond as well:
64 bytes from 172.31.11.169: icmp_seq=959 ttl=125 time=0.181 ms
64 bytes from 172.31.11.169: icmp_seq=960 ttl=125 time=0.178 ms
So far I isolated the apps on a dedicated server with no change. Increasing instance CPU from 4 to 8 reduces the latency by half, but still happens with the same frequency. The process itself is simple, it’s a queue, not cpu intensive, a few EF queries. Grafana shows < 5% cpu usage for the pod in a dedicated instance.
What could cause this delay while executing commands?