Linux – Is installing multiple redis instances on the server a good idea

linuxredissession

As title says. I'm considering creating a state service farm using redis, and I'd like to handle multiple "regions" – that way, if a service goes down only a single region should be affected. This may seem like a good idea initially, but I'd rather know beforehand if :

  1. Installing multiple side-by side instances of redis is a good
    idea?
  2. Redis only stores data in RAM?
  3. How much RAM a typical
    redis instance uses? (I realize this may be a rethorical question,
    but I'd love some guesstimates)

Best Answer

At Stack Exchange we run multiple instances of Redis on a single server and we have never seen any issues:

[kbrandt@ny-redis01: ~] ps -e -o vsz,cmd | grep redis-server | sort -nr
15943668 /usr/sbin/redis-server *:6382
14966708 /usr/sbin/redis-server *:6379
7878376 /usr/sbin/redis-server *:6380
2692092 /usr/sbin/redis-server *:6384
1855480 /usr/sbin/redis-server *:6383
1002304 /usr/sbin/redis-server *:6381
377072 /usr/sbin/redis-server *:6385
374780 /usr/sbin/redis-server *:6387
 50992 /usr/sbin/redis-server *:6388
 50992 /usr/sbin/redis-server *:6378

Memory usage is really going to depend on how much data you put into each instance. There can also be some fragmentation overhead (you can see the fragmentation ratio with the redis info command). To estimate your capacity you look at "What's the Redis memory footprint?" from the faq. Also be sure to set /proc/sys/vm/overcommit_memory to 1 as stated in that same faq.