REDIS Sizing exercise

Learn
2 min readFeb 19, 2025

--

What is the memory size your REDIS instance needs?

Value Size
Look at the value you are putting into REDIS. Five strings, couple of date fields. For string fields, see what the max number of character each of those fields can need. Similarly, for the date, see how many characters are needed. Add the total number of characters. That is roughly the number of bytes you need.

Account for future additions to the value that might come up, and add up say 10 percent or so.

Peak volume
Look at your business flow, and see what is the maximum number of REDIS PUTs that can come in at peak time in a single minute.

Time to live
How long does the REDIS data need to stay? Say two hours. We had looked at the peak volume. This is the peak volume in one minute. If the peak volume persists for two hours, then you have one hundred twenty times the peak volume in a minute.

Load balancing
Now, does your deployment have one REDIS instance, or multiple of them. Say, there are five instances. Then the REDIS load can be equally shared between these five instances. So this is a division factor unlike the previous factors
— Peak volume
— Size
— Time to live

Fail over
Now you need to account for instances in your cluster being unavailable. You expect that two of these five can potentially go down. So this would change the division factor of load balancing from 5 to 3.

Once you do all the math, you get a GB number that you need from these REDIS instances.

--

--

Learn
Learn

Written by Learn

On a continuing learning journey..

No responses yet