Skip to content
ENExplore Calculators

Redis Memory Calculator

Estimate Redis memory use from key count, value size and overhead.

About Redis Memory Calculator

Per-key overhead dominates when values are small, so millions of tiny keys cost far more than the data suggests. Replicas hold full copies, so cluster memory multiplies with the replica count. Redis becomes unstable rather than merely slow when it approaches its memory limit, which is why maxmemory should sit around 25 per cent above the working set.

Formula

Redis Memory

Memory = keys × (key + value + per-key overhead), plus replica copies

per-key overhead
Redis metadata per entry, roughly 50 to 100 bytes
maxmemory
Configured cap, set above the working set to leave room for fragmentation

Worked example

With the default values below, Redis Memory Calculator returns Memory Required of 2.0955. Change any input above and every figure here is recalculated in your browser.

Inputs used

Number of keysminimum 0
5,000,000
Average key lengthminimum 0 bytes
40 bytes
Average value sizeminimum 0 bytes
320 bytes
Per-key overheadminimum 0 bytes
90 bytes
Replicasminimum 0
1

Results

Memory Required
2.0955 GB
Memory Holding Data
1.6764 GB
Memory Consumed by Overhead
0.4191 GB
Memory Including Replicas
4.1910 GB
Recommended maxmemory Setting
2.62 GB

Step by step

  1. 1Values used
  2. 2Redis Memory
  3. 3Memory Required= 2.0955 GB
  4. 4Memory Holding Data= 1.6764 GB
  5. 5Memory Consumed by Overhead= 0.4191 GB
  6. 6Memory Including Replicas= 4.1910 GB
  7. 7Recommended maxmemory Setting= 2.62 GB

Assumptions and limits

  • The result is derived only from the 5 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 4 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How is Redis Memory calculated?

Memory = keys × (key + value + per-key overhead), plus replica copies Per-key overhead dominates when values are small, so millions of tiny keys cost far more than the data suggests. Replicas hold full copies, so cluster memory multiplies with the replica count.

Why does Redis Memory matter?

Redis becomes unstable rather than merely slow when it approaches its memory limit, which is why maxmemory should sit around 25 per cent above the working set.

What values do I need to enter?

This calculator takes 5 inputs: Number of keys, Average key length, Average value size, Per-key overhead, Replicas. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

Redis Memory Calculator – Calculate Memory Required