01A valid key with no TTL is removed while Redis is over `maxmemory`. Which eviction policies could have allowed that, and which could not?introScenarioAn incident review found that a key with no TTL disappeared while the server was at its memory limit.AAllkeys policies can remove a non-TTL key, while volatile policies cannot because they only choose among keys with expiration metadata.BOnly volatile policies could, because they fall back to non-TTL keys whenever no TTL keys remain to evict, logging a warning each time the fallback widens the candidate pool.CAny policy could have done it, since over maxmemory Redis ignores policy scope and frees whichever keys are largest.DOnly noeviction could, because it removes keys without TTLs specifically to protect data that is set to expire.
02A workload reads one hot key constantly. Why would exact LRU track it better than sampled LRU, and why might Redis still prefer sampling?introScenarioYou are evaluating whether precise recency tracking would be worth its cost for a cache with one very hot key.ASampled LRU tracks hot keys better because sampling naturally favors the keys it sees most often.BRedis uses exact LRU for small keyspaces and switches to sampling automatically above a size threshold.CExact LRU observes every access, but sampling is cheaper and usually good enough for Redis latency and memory overhead goals.DExact LRU would require pausing writes during its list maintenance, which is why no production system implements it.
03What should happen under `volatile-lru` when no keys have TTLs and a write needs memory?appliedScenarioA cache is configured with `volatile-lru`, but the application never sets TTLs on any of its keys.ARedis evicts the least-recently-used key anyway, because staying available outranks the policy's scope.BThe write succeeds and maxmemory rises automatically by a configured overshoot factor.CThe write blocks until some key receives a TTL or memory is freed by another code path, waking periodically to retest whether the allocation now fits.DThe write should receive an OOM error because volatile-lru has no legal eviction candidate when no keys have TTLs.
04Distinguish memory used by key values from memory used by client output buffers and replication backlog. Why does this complicate enforcement?appliedScenarioA server at its memory limit is also fanning out large replies to slow clients and feeding a replication backlog.AAll memory looks identical to the allocator, so enforcement needs only the single global used-bytes counter.BValue memory, client output buffers, and replication backlog are owned by different subsystems, so enforcement must account for more than key payload size.COutput buffers and the backlog are allocated outside the Redis process, which puts them beyond what maxmemory can observe.DThe complication is double-counting, since values referenced by output buffers would otherwise be freed twice.
05Which commands should be denied under OOM when eviction cannot free enough memory?advancedScenarioEviction has run out of candidates but clients keep sending commands to the full server.AAll commands including reads should be denied, since even GET allocates a reply buffer to serve its result.BOnly commands on keys without TTLs should be denied, steering new writes toward data that can be evicted.CCommands that allocate or grow memory should be denied when eviction cannot free enough memory; read-only commands can usually continue.DDEL and expiration activity should be denied as well, freezing the keyspace until an operator intervenes — better a frozen dataset than one mutating under pressure.