Azure Cache Redis Slow Performance rather than DB query

Viewed 111

We have implemented Azure Cache Redis for our project. But the problem is Azure Cache query performance is slower than db query. For a query while Redis response average is 115ms the db query average is 60ms. For another query while Redis response average is 200ms db query average is 210ms. I expected redis queries to return around 50ms for all requests. Is this normal or are we missing any point. Maybe speed is not the case all the time?

2 Answers

The performance of AzureRedis cache queries depends on various criteria:

  • First, you need to check out the source from where you are querying the Redis cache. If the source and Redis cache resource are in different regions, there may be a significant network latency.

  • The pricing tier of the Redis cache also plays a crucial role in the performance.

  • Use the redis-benchmark.exe utility to check the throughput and characteristics of your cache.

  • You can also consider the scaling link to improve the performance of the Redis cache.

Possible reasons why query run time varies:

  • Different data volumes
  • Different system load
  • Different query plans

This also can depend on the type of query. In this case SQL database vs Redis.

A website tested this and achieved the following conclusion:

Graph of benchmark timing

Especially if your request number is large, it's always better to use db and Redis together. Otherwise, both are nearly equal and change in their timings per query.

Related:

Related