跳至內容

Is there a downtime during eviction phase of elastic cache serverless ?

0

The Elastic Cache Serverless documentation says "Evictions occur when cache memory is overfilled or is greater than the maxmemory setting for the cache, causing the engine to select keys to evict to manage its memory." https://docs.aws.amazon.com/whitepapers/latest/database-caching-strategies-using-redis/evictions.html

If I set eviction policy based on ttl : a) Will it cause downtime of cache (not accepting any read or write) when the cache is full ? (Or the eviction running in background without causing outage) b) Can TTL based eviction be triggered much earlier before cache reaching 100%

已提問 2 年前檢視次數 486 次
1 個回答
0
  1. Evictions do not cause downtime. They are handled in the background, allowing Redis to continue serving read and write operations.
  2. While you cannot directly trigger evictions before the cache is full, you can manage the maxmemory setting to start evictions at a desired memory usage level.
CONFIG SET maxmemory 1gb
CONFIG SET maxmemory-policy volatile-ttl

By setting the maxmemory configuration appropriately, you can ensure that evictions start before the cache reaches 100% utilization. For example, setting maxmemory slightly below the physical memory limit can provide a buffer for the eviction process to begin earlier.

The specific behavior of evictions depends on the eviction policy you have set. With a TTL-based eviction policy (volatile-ttl), Redis will attempt to evict keys with the shortest time-to-live first. This is a way to free up memory without disrupting ongoing operations.

專家
已回答 2 年前
專家
已審閱 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。