Short Answer
Redis stores the working set in RAM. If your working set is bigger than your memory, you need either more memory or to evict old data with an LRU policy.
Detailed Answer
Redis is an in-memory store, so memory is the constraint. The first thing to check: are you storing values you don't need? Common offenders are unbounded session lists, message queues without a TTL, and large JSON blobs you could store elsewhere. The next lever is `maxmemory-policy`. If you don't set it, Redis will return errors once it hits the limit. The common choices are `allkeys-lru` (evict least-recently-used keys) and `volatile-lru` (only evict keys with a TTL set). For a pure cache, `allkeys-lru` is usually right. If memory is genuinely the bottleneck and the data is hot, the real answer is: pay for more memory, or shard across multiple Redis nodes. Redis Cluster gives you sharding but the client library needs to be cluster-aware.
No answers yet
Be the first to answer this question!
Sign in to post an answer