StackExchange.Redis.RedisTimeoutException: Timeout awaiting response

Are you getting the RedisTimeoutException like below? But you have tried to take a look at the article suggested from the error message https://stackexchange.github.io/StackExchange.Redis/Timeouts but still unable to solve it?

fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "xxxxxx", Request id "yyyyy:00000002": An unhandled exception was thrown by the application.
      StackExchange.Redis.RedisTimeoutException: Timeout awaiting response (outbound=0KiB, inbound=0KiB, 5283ms elapsed, timeout is 5000ms), command=HMGET, active: HMGET REDIS_ID, next: HMGET REDIS_ID, inst: 0, qu: 0, qs: 9, aw: False, rs: ComputeResult, ws: Idle, in: 0, in-pipe: 2037, out-pipe: 490, serverEndpoint: 192.168.1.107:6379, mc: 1/1/0, mgr: 8 of 10 available, clientName: zzzzz, IOCP: (Busy=0,Free=1000,Min=16,Max=1000), WORKER: (Busy=18,Free=32749,Min=16,Max=32767), v: 2.2.4.27433 (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 Microsoft.Extensions.Caching.StackExchangeRedis.RedisExtensions.HashMemberGetAsync(IDatabase cache, String key, String[] members)
         at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token)
         at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token)
         at Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.GetStringAsync(IDistributedCache cache, String key, CancellationToken token)

If this is your scenario and you are using docker container for your app and Redis, you can try check either feasible for your architecture to configure as your app connect to Redis using same docker network internally directly instead of expose Redis port to the docker host and then connect your app to Redis port via docker host. It might be able to resolve your RedisTimeoutException issue.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.