I have a web API on Azure App Service using .Net 7 and Azure Cache for Redis. Recently, it has been throwing RedisTimeoutException errors. The following are some of the exceptions:
StackExchange.Redis.RedisTimeoutException: Timeout awaiting response (outbound=0KiB, inbound=0KiB, 5813ms elapsed, timeout is 5000ms), command=EXISTS, next: EXISTS xxxx, inst: 0, qu: 0, qs: 0, aw: False, bw: SpinningDown, rs: ReadAsync, ws: Idle, in: 0, last-in: 725, cur-in: 0, sync-ops: 112, async-ops: 6861, serverEndpoint: xxxx, conn-sec: 780.17, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: xxx(SE.Redis-v2.6.122.38350), IOCP: (Busy=0,Free=1000,Min=1,Max=1000), WORKER: (Busy=4,Free=32763,Min=1,Max=32767), POOL: (Threads=5,QueuedItems=4,CompletedItems=270390,Timers=48), v: 2.6.122.38350
At first, I suspected that this was due to a noisy neighbor, as the cache was running on the Standard C0 tier. However, after scaling up to the C1 tier, the issue still persists. Before scaling, the Redis server load was always below 50%, but after scaling, it has consistently been hitting 100%.
The error message you provided,
StackExchange.Redis.RedisTimeoutException: Timeout awaiting response, indicates that your application is timing out while waiting for a response from the Redis serverCreated a console application in C# that interacts with a Redis cache and uses the
EXISTScommand to check if a key exists in the cacheResult
Above Code check whether Value: myKey is present in cache or not
You can also refer to this Link