Guide · Redis

The Redis Reliability Guide

Redis is fast until it is not, and the reasons are almost always the same five. This guide takes them in the order they arrive on a production estate, gives the short answer at each step, and points to the article that works it in full. Everything here applies to Valkey as well.

Tyler Eastridge

By Tyler Eastridge, Head of Operations

LinkedIn · Updated

4 min read7 sections
On this page
Reliability in one paragraph

Reliability in one paragraph

Choose the high-availability mode by the failure you are protecting against: Sentinel for a replicated single dataset with automatic failover, Cluster for sharding across nodes. Size memory to the peak dataset plus replication and fork overhead, and choose an eviction policy on purpose, because the default is noeviction and the write errors that follow look like an outage. Memory that grows while key counts stay flat is fragmentation, large values or client buffers, not a leak. Client timeouts on a server that reports healthy are usually a slow command, a fork stall during a snapshot, or a connection pool that is too small. Run the failover before production does, and know who you call when the fix is not in the runbook.

Sentinel or Cluster: choose by the failure, not the feature list

Sentinel gives one dataset, replicated, with monitored automatic failover; it fits estates that need availability rather than capacity. Cluster shards the keyspace across nodes with a replica per shard; it fits datasets that do not fit one node or throughput that does not fit one core, and it changes how clients and multi-key commands behave. Both fail over; they fail over differently, and clients must be configured for whichever one you run.

Size memory to the peak, and choose eviction on purpose

The dataset is not the memory requirement. Add replication buffers, client output buffers, and the copy-on-write overhead of a fork during a snapshot or a full sync, and size to the peak of all of that. Then set maxmemory and an eviction policy that matches the workload: an LRU or LFU policy for a cache, noeviction only where a write error is genuinely preferable to losing a key. The default is noeviction, and most first outages are that default meeting a full instance.

Memory growing while key counts stay flat

Not a leak. Fragmentation after churn on values of varying size, a small number of very large values, streams or lists that grow without trimming, and client output buffers for slow consumers all grow memory without adding keys. INFO memory and the memory-usage commands per key find it; active defragmentation and value trimming fix most of it.

Client timeouts on a server that reports healthy

Redis is single-threaded for commands, so one slow command, a KEYS in production, a large SMEMBERS, a Lua script, delays everything behind it. A fork for RDB or AOF rewrite can stall the process on a busy instance. A connection pool that is too small queues on the client side and looks like a server timeout. The slow log and latency monitoring separate the three; the fix is different for each.

Run the failover before production does

A documented failover is a hypothesis. Kill the primary with clients connected and watch what happens: how long Sentinel takes to promote, whether clients reconnect to the new primary or keep writing to a stale one, whether a Cluster slot migration completes, and what the application does with the writes that were in flight. Time it; that is your real recovery time.

Troubleshooting, and when to escalate

Most Redis incidents are found in four places: the slow log, INFO memory and persistence sections, the client list, and the replication state. The troubleshooting post gives the sequence; the escalation question is whether the fix is in your runbook or whether it is a replication, persistence or cluster-topology problem where a wrong step loses data.

Valkey: the same guide, a different fork

Valkey forked from Redis 7.2 under the Linux Foundation, and everything above applies to it: the same HA modes, memory model, eviction policies and single-threaded command path. The divergences are specific and knowable, and they mostly concern newer features and tooling. Whether to migrate is a licensing and governance decision more than a technical one.

Frequently asked questions

Should I use Redis Sentinel or Redis Cluster?

Sentinel when you need one replicated dataset with automatic failover. Cluster when the dataset or the throughput does not fit one node and you can live with sharded semantics for multi-key commands. Availability alone does not require Cluster.

Why is Redis using more memory than my data?

Replication and client output buffers, copy-on-write overhead during snapshots and full syncs, and fragmentation after churn. Size to the peak of all of those, not to the dataset, and turn on active defragmentation where fragmentation ratio stays high.

Which Redis eviction policy should I use?

For a cache, an LRU or LFU policy over all keys or over keys with a TTL. Keep the default noeviction only where a write error is genuinely preferable to losing a key. Most first outages are the default meeting a full instance.

Does this guide apply to Valkey?

Yes. Valkey forked from Redis 7.2 and shares the HA modes, memory model, eviction policies and single-threaded command path. AceMQ supports both in production.

Redis services

Where this gets done

More resources

Other Redis guides, comparisons and research

From the blog

Recent Redis articles

Next step

Need this done on your Redis or Valkey estate?

Named senior engineers for latency, memory, replication and failover, 24/7, with a 15-minute emergency SLA.