A developer is configuring a Premium tier Azure Cache for Redis instance for a retail e-commerce application. The cache stores two types of data: product inventory levels (which are critical and must never be evicted, and do not have an expiration time set) and user search queries (which have an expiration time set). Under memory pressure, the system must only evict search query data while preserving all product inventory levels. Additionally, you must reserve memory for background processes to ensure stable replication and failover operations. Which two configuration settings should you implement to meet these requirements?
- Configure the maxmemory-policy setting to volatile-lfuCevap
- Configure the maxmemory-reserved setting to allocate memory for non-data operationsCevap
- CConfigure the maxmemory-policy setting to allkeys-lfu
- DConfigure the maxmemory-policy setting to allkeys-random
Cevap
To configure the Azure Cache for Redis instance correctly, you should set the maxmemory-policy setting to volatile-lfu and configure the maxmemory-reserved setting to allocate memory for non-data operations.
Configuring volatile-lfu ensures that only keys with an expiration time set (the transient search queries) are evicted when the cache is full. Configuring maxmemory-reserved ensures that a portion of memory is reserved for non-cache operations such as replication and clustering overhead, preventing out-of-memory errors during failovers.
Adım Adım Çözüm
Anahtar Kavram
Memory eviction policies and memory reservation in Azure Cache for Redis
Tahmini Süre:1m 30s