Cloud & Operations · Practical News

Redis Memory Full: Eviction or Write Failures

Source: Paddy Dance teamKeywords: redis memory full fix

Confirm the policy

maxmemory is the ceiling and maxmemory-policy decides what happens at the ceiling. allkeys-lru evicts least recently used keys, volatile-lru only evicts keys with a TTL, noeviction returns errors.

For caching, allkeys-lru is typical. If you use Redis as a datastore, never choose an eviction policy that discards data.

Find what is consuming memory

Scan with --bigkeys and inspect individual entries with MEMORY USAGE. Hashes with hundreds of thousands of fields and multi-megabyte strings are the usual culprits.

Also count keys without TTL. Code that sets values without expiry only grows, and memory eventually runs out.

Fix the structure

Split big keys: a million-field hash should become several hashes split by business dimension, making reads and writes cheaper.

Give every cache key a sensible TTL with random jitter, so expiry does not happen simultaneously and cause a stampede.

FAQ

What causes OOM command not allowed?

Memory reached maxmemory with noeviction. Either scale, change policy, or remove data.

Can eviction delete important data?

allkeys policies can. Keep critical data in a separate instance, or use a non-evicting policy with proper capacity planning.

Memory jumped suddenly. How do I investigate?

Look for abnormal writes, newly created big keys, or client buffer growth (check omem in CLIENT LIST).

Related questions

OOM command not allowedwhich maxmemory-policy to usefind redis big keysredis memory keeps growing

Further reading

Sources & References

The following are public sources. Always check the latest requirements on the official authority or platform page.

Explain your case first, then confirm the scope

Tell us your entity, business model and current progress. We will confirm what we can assist with and what you need to do before discussing fees.