Redis: Database Size to Memory Ratio? Redis: Database Size to Memory Ratio? database database

Redis: Database Size to Memory Ratio?


Redis will use a bit more RAM than disk. The dumpfile format is probably a bit more densely packed. This is some numbers from a real production system (a 64 bit EC2 large instance running Redis 2.0.4 on Ubuntu 10.04):

$ redis-cli info | grep used_memory_humanused_memory_human:1.36G$ du -sh /mnt/data/redis/dump.rdb 950M /mnt/data/redis/dump.rdb

As you can see, the dumpfile is a few hundred megs smaller than the memory usage.

In the end it depends on what you store in the database. I have mainly hashes in mine, with only a few (perhaps less than 1%) sets. None of the keys contain very large objects, the average object size is 889 bytes.


Redis databases are stored in memory, so an 80mb database would take up 80mb in ram.

Redis is an extremely low memory using program, and you can see that from this example from the website "1 Million keys with the key being the natural numbers from 0 to 999999 and the string "Hello World" as value uses 100MB [of Ram]". My Redis app uses around 300kb to 500kb of ram, so you would need a lot of data to reach a database of 80mb. Redis also saves to disk snapshots of the database, so 80mb in ram and 80mb on the hard drive.