How to estimate how large a redis database will be?
Asked Answered
C

1

5

I'm trying to decide what size Redis To Go option to go for in heroku.

Say that I want to keep about a million records in Redis for easy access.

If each record is about 1-10kb in size, does this mean that the entire database will be 1,000,000 * 1-10kb or is there some hidden overhead that I don't know about?

Colloidal answered 16/7, 2012 at 0:32 Comment(0)
H
14

Can you start with the smallest option and gain access to the CLI interface? If so, you can do the following:

redis-cli
> info

View the following and note values:

used_memory:931104
used_memory_human:909.27K
used_memory_rss:1052672
used_memory_peak:931008
used_memory_peak_human:909.19K

Then load 100k records and perform the same thing and compare the difference in memory. It's really hard to tell just by guessing on size, and note that there is overhead (the figures above are vanilla install with no data on my MacBookPro 2011 w/ OSX Lion).

Homologous answered 16/7, 2012 at 0:41 Comment(2)
After you gauge the usage with sample data set, you can determine if you need to upgrade to higher capacity plan and this way you're not over-committing by guessing.Homologous
My pleasure. Have fun with Redis. It took a bit for my mind to get around choosing which data type to use for which problem, but I really like it. I ran some benchmarks on a single linux server and a simple write/read with Node.JS and Redis was averaging over 10,000 requests/second so it's blazing fast.Homologous

© 2022 - 2024 — McMap. All rights reserved.