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%

asked a year ago320 views
1 Answer
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.

profile picture
EXPERT
answered a year ago
profile picture
EXPERT
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions