Learn Labs
Expiration & Memory

Self-test

Check your understanding

Self-test11 questions

—/11
  1. Explain lazy and active expiry. Why does Redis need both?

  2. Which commands keep a key's TTL and which clear it?

  3. Why add jitter to TTLs? What happens without it?

  4. What does maxmemory not count, and why does that matter for sizing the container?

  5. Choose an eviction policy for a pure cache, a session store, and a job queue. Justify each.

  6. Your instance uses volatile-lru and writes are failing with OOM errors. What's the likely cause?

  7. How does Redis approximate LRU without a linked list of all keys? How does LFU resist scans?

  8. What does a fragmentation ratio below 1.0 mean? Above 1.5?

  9. Name three harms of a big key and two ways to fix one.

  10. What's a hot key, and why doesn't adding cluster nodes help?

  11. Design question

    A 32 GB Redis is at 95% of maxmemory and evicting. Walk through how you'd find what's using the memory and reduce it.