Hi @Vishweshwar-3323 ,
Welcome to Microsoft Q&A forum.
As I understand, you are fetching all the keys from Redis. But it takes a lot of time to fetch and sometimes it gives the error of timeout.
Review the commands that you're issuing to your Redis server to understand their performance impacts. For instance, the KEYS command is often used without knowing that it's an O(N) operation. You can avoid KEYS by using SCAN to reduce CPU spikes.
More options are illustrated here Investigating timeout exceptions in StackExchange.Redis for Azure Redis Cache
Azure Cache for Redis works best with smaller values. Consider dividing bigger chunks of data in to smaller chunks to spread the data over multiple keys. Additional reference thread What is the ideal value size range for redis? Is 100KB too large?
https://redis.com/blog/redis-clustering-best-practices-with-keys/
Use Standard or Premium tier for production systems. Don't use the Basic tier in production. The Basic tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are only meant for simple dev/test scenarios because:
- they share a CPU core
- use little memory
- are prone to noisy neighbor issues
Hope this helps. Please let us know if you have further questions. Thank you.