Redis maxmemory Calculator

maxmemory caps how much data Redis keeps before it starts evicting keys — for a cache, it's the setting that trades hit rate against memory cost. The Redis process needs more than maxmemory, though: fragmentation, client buffers and the fork used for snapshots all sit on top of it. This calculator sizes maxmemory from observed usage and tells you how much memory to give the host or container.

01 Usage data

Enter observed used_memory directly, in MiB.

02 Workload profile

Advanced: margins and defaults

Values the result relies on that are our own defaults, or vendor defaults your setup may change. Each “?” says how one moves the result; the guide says where it comes from.

03 Sizing gauge

0 —

04 redis.conf

—

05 How this was derived

Enter usage data to see the calculation.

maxmemory and provisioning in short

maxmemory is the most memory Redis uses for data; past it Redis applies the eviction policy. allkeys-lru evicts the least recently used keys, while noeviction returns errors for writes at the limit. Buffers for replication and the AOF don't count towards maxmemory, so Redis can use somewhat more. Redis docs

The calculator sizes maxmemory from the peak used_memory plus a margin, with a floor from the average. The margins are MemoryLimit's own defaults, changeable under Advanced. It writes allkeys-lru, taking this Redis to be a cache.

It also tells you how much memory to give the process: in a write-heavy application Redis can use up to twice its normal memory while it saves an RDB file or rewrites the AOF, so the calculator provisions 2 × maxmemory. Without persistence or replication it suggests about 1.25 ×. Redis docs

Common input mistakes

  • Using allkeys-lru for data you can't lose: use noeviction, so writes fail at the limit instead.
  • Provisioning only maxmemory: in a write-heavy application the process can need up to twice that while it saves an RDB file or rewrites the AOF.
  • Setting maxmemory equal to the memory you have: Redis advises setting it below the free memory, to leave room for its overhead and fragmentation.

Full derivation, warnings and every assumption: how the Redis calculator works. The shared formula and margin tables: the sizing model.

Related calculators: