I am needing to set up a Redis server, how much RAM do I need to allow for the server?
-
4how long is a string? – Javier Jan 06 '11 at 02:24
-
This is a poor question. Capacity needs are determined by the size of your dataset in almost any circumstance. – gWaldo Dec 07 '11 at 14:13
3 Answers
I would recommend installing redis on something, your laptop, whatever you have available now.
Then generate some nontrivial amount of data shaped like what you plan to store on the eventual server. Say 100,000 values. Then, load that into redis in the way you expect your application to.
Then, see how much memory redis is using:
redis-cli info | grep "used_memory"
And use that to estimate how much memory you will need based on the amount of data you want to plan for. You need to leave some spare memory for the OS and other core systems to function. I would leave at least a couple GB of memory for those.
If you run redis at half or more of the system memory you will want to read about enabling this in your /etc/sysctl.conf file:
vm.overcommit_memory
There is more information about why that is necessary on the redis FAQ:
There are tricks for getting more data into redis using certain data structures to limit memory usage. You can read about that on their FAQ and blog.
![](../../users/profiles/103354.webp)
- 181
- 2
- 7
I'm buying a car, how many seats do I need?
In general, take whatever you think you might possibly need and double it. Hardware is cheap. It's a lot easier to drive around with a few extra seats than it is to add seats later.
![](../../users/profiles/48573.webp)
- 912
- 6
- 12