Redis Eviction Policy Simulator

Give maxmemory, the dataset size and the policy. The result says what happens at the limit and whether the policy can actually do anything.

Paste below, or drop a file anywhere on this panel

Or drop a file anywhere on this panel. Nothing is uploaded: the analysis runs in this tab.

The answer appears here

Paste on the left and press Calculate. Nothing leaves this tab.

Examples

Real input you can load into the tool above. Each one shows a different thing going wrong, because that is what the tool is for.

The default policy

noeviction, which refuses writes at the limit while reads keep working

maxmemory: 4gb
dataset: 3gb

volatile with no TTLs

A policy that cannot evict anything, so it behaves exactly like noeviction

maxmemory: 4gb
dataset: 3gb
maxmemory-policy: volatile-lru
keys-with-ttl-percent: 0

Common mistakes

These are the ones that fail silently. The config is accepted, nothing raises an error, and the consequence arrives later.

  1. Leaving the default on a cache

    noeviction refuses writes at the limit. For a cache that is an outage, and it arrives by omission rather than by decision.

    Instead:allkeys-lru or allkeys-lfu for a cache.

  2. Choosing volatile- without TTLs on the keys

    Only keys with a TTL are eligible. With none, nothing can be evicted and writes fail exactly as with noeviction.

    Instead:Confirm keys actually get a TTL, or use the allkeys- variant.

  3. Expecting LRU to be exact

    Redis samples maxmemory-samples keys and evicts the best of the sample, not the true least-recently-used key.

    Instead:Raise the sample size for accuracy, at a CPU cost. LFU is usually better where a small set is hot.