#167·redis

Issues Implementing Redis Caching in Web Application

Author: deepak0878Created May 16, 2025Updated May 16, 2025

Hi,

We are implementing Redis in our web application to improve performance, but we are facing a few challenges. Let me explain the scenario:

We have a complex stored procedure that returns a large dataset (up to 10,000 records) when no filters are applied. This procedure is accessed simultaneously by multiple users and often results in timeout errors.

StackExchange.Redis.RedisTimeoutException: 'Timeout awaiting response (outbound=6684KiB, inbound=0KiB, 5297ms elapsed, timeout is 5000ms), command=SET, next: SET SubscriptionBooks:620602d5-edd2-4b7a-8ccc-74b41b940fa4, inst: 0, qu: 0, qs: 1, aw: False, rs: ReadAsync, ws: Idle, in: 0, in-pipe: 0, out-pipe: 0, serverEndpoint: 10.158.59.114:6379, mc: 1/1/0, mgr: 10 of 10 available, clientName: SYS-USER, IOCP: (Busy=0,Free=1000,Min=16,Max=1000), WORKER: (Busy=14,Free=32753,Min=16,Max=32767), v: 2.2.62.27853 (Please take a look at this article for some common client-side

To address this, we are considering using Redis to cache the results and serve data from Redis instead of querying the SQL database every time.

We have the following queries:

  • By default, the stored procedure returns 10,000 records if no filters are selected. - We attempted to store all 10,000 records under a single Redis key but encountered timeout errors. - How can we resolve this issue?
  • Even if we store the 10,000 records in chunks, we still get timeout errors while retrieving the data from Redis.
  • Is there any way to apply filters directly on the Redis data instead of relying on the stored procedure?

Please let us know if you need more information.

Thanks Deepak