fivenines

Practice / target 80%

Memory Limits And Eviction Practice

01

A valid key with no TTL is removed while Redis is over `maxmemory`. Which eviction policies could have allowed that, and which could not?

intro

Scenario

An incident review found that a key with no TTL disappeared while the server was at its memory limit.

02

A workload reads one hot key constantly. Why would exact LRU track it better than sampled LRU, and why might Redis still prefer sampling?

intro

Scenario

You are evaluating whether precise recency tracking would be worth its cost for a cache with one very hot key.

03

What should happen under `volatile-lru` when no keys have TTLs and a write needs memory?

applied

Scenario

A cache is configured with `volatile-lru`, but the application never sets TTLs on any of its keys.

04

Distinguish memory used by key values from memory used by client output buffers and replication backlog. Why does this complicate enforcement?

applied

Scenario

A server at its memory limit is also fanning out large replies to slow clients and feeding a replication backlog.

05

Which commands should be denied under OOM when eviction cannot free enough memory?

advanced

Scenario

Eviction has run out of candidates but clients keep sending commands to the full server.

Ready to build

Design the system.

Put the learned theory into real-life practice and get architectural feedback.