Developer tools · Capacity

Redis memory calculator.

Turn a measured MEMORY USAGE figure into a maxmemory setting and a host RAM budget.

Uses your measured bytesReplicas includedChecked 16 October 2026

Advertisement

Inputs

Memory budget

Enter the values.

How much memory does Redis need for N keys?

Redis memory per key depends on the data type, the value size, the key name length and the allocator, so a fixed per-key constant would mislead. Instead, measure: run MEMORY USAGE <key> on a few typical keys (it reports bytes for the key and value including administrative overhead and allocator rounding) and enter the average. For reference, the Redis docs show an empty string at 56 bytes on Redis 7.2 with jemalloc and a 100 character value at 160 bytes.

Worked example. 1,000,000 keys at 100 bytes each is 100 MB. With 20% growth that is 120 MB; keeping 20% free under maxmemory gives a maxmemory of 150 MB; at a fragmentation ratio of 1.1 the process uses about 165 MB of RAM, and one replica doubles the total to 330 MB.

Redis does not always return freed memory to the operating system, so the docs advise provisioning for peak memory use. Small hashes, lists, sets and sorted sets use compact encodings that the docs say can use up to 10 times less memory (5 times on average), so measure the real encoding. This tool does not cover replication buffers, client buffers, persistence fork copy-on-write or modules.

Frequently asked questions

How do I find how much memory a Redis key uses?

Run MEMORY USAGE key. It returns the bytes for the key and its value including overhead. For aggregate types you can raise SAMPLES to average more nested values.

How much RAM does 1 million Redis keys use?

It depends on key and value size. At 100 bytes per key it is about 100 MB before growth, headroom and fragmentation. Measure your own keys with MEMORY USAGE rather than trusting a rule of thumb.

What should maxmemory be set to?

Set it below the host RAM with room for the operating system, buffers and fork copy-on-write. This tool sizes maxmemory as your data plus planned growth, divided by one minus the free headroom you want.

Do replicas need as much memory as the primary?

A replica holds a full copy of the dataset, so plan roughly the same RAM for each replica as for the primary.

Sources

Checked

The 56 and 160 byte examples are from the Redis MEMORY USAGE page (Redis 7.2, jemalloc). The tool applies no hidden per-key constant: bytes per key is your own measurement. Runs entirely in your browser. Nothing you type is sent or stored.

Scope

Planning estimates, not guarantees. Real systems add overhead this model leaves out and behave differently under load. Measure on your own data and load-test before committing to a design or a bill.

Advertisement
Advertisement