-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
I am frequently encountering RedisTimeoutException errors in my application. The application is built using .NET 9 and runs in Linux-based containers. Redis is hosted on AWS Elastic Cache with version 7.0.7. The errors primarily occur when executing commands such as HSETNX and EXISTS.
RedisTimeoutException: Timeout awaiting response (outbound=1KiB, inbound=0KiB, 6670ms elapsed, timeout is 6000ms), command=HSETNX, next: HSETNX key1, inst: 0, qu: 0, qs: 12, aw: False, bw: SpinningDown, rs: ReadAsync, ws: Idle, in: 48, in-pipe: 0, out-pipe: 0, last-in: 1, cur-in: 0, sync-ops: 0, async-ops: 10624065, conn-sec: 17185.91, aoc: 1, mc: 1/1/0, mgr: 10 of 10 available, clientName: (SE.Redis-v2.7.17.27058), IOCP: (Busy=0, Free=1000, Min=1, Max=1000), WORKER: (Busy=25, Free=32742, Min=16, Max=32767), POOL: (Threads=45, QueuedItems=2996460, CompletedItems=9313485654, Timers=45774730), v: 2.7.17.27058
Checking Redis Key existence for [key3] failed with: RedisTimeoutException: Timeout awaiting response (outbound=1KiB, inbound=0KiB, 6660ms elapsed, timeout is 6000ms), command=EXISTS, next: HSETNX key2, inst: 0, qu: 0, qs: 12, aw: False, bw: SpinningDown, rs: ReadAsync, ws: Idle, in: 48, in-pipe: 0, out-pipe: 0, last-in: 1, cur-in: 0, sync-ops: 0, async-ops: 10624065, conn-sec: 17185.92, aoc: 1, mc: 1/1/0, mgr: 10 of 10 available, clientName: (SE.Redis-v2.7.17.27058), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=25,Free=32742,Min=16,Max=32767), POOL: (Threads=45,QueuedItems=2980005,CompletedItems=9313502106,Timers=45774924), v: 2.7.17.27058
EndPoints = new EndPointCollection
{
PrimaryEndpoint,
ReaderEndpoint
},
.NET Version: .NET 9
Operating System: Linux (running in containers)
Redis Server:
Hosted on AWS
Version: 7.0.7
Redis Client Library: StackExchange.Redis v2.7.17
Redis Usage in Code: Async operations are used exclusively for interacting with Redis (e.g., await SetAsync, await GetAsync, async/await keywords for I/O operations like HSETNX and EXISTS).
And I have a Primary with Replicas on AWS and I am passing Primary Endpoint and ReaderEndpoint as above.Is it the recommended way or does this impact the TimeOuts.