Search code examples
redisredis-cluster

How to setup max memory for a redis5.0.5 cluster


I have a redis cluster with 4 servers with 24 GB memory each. Each server has a master and a slave instance running.

Cluster topology: (A-->B means A is slave of B)

server2 slave-->server1 master
server3 slave-->server2 master
server4 slave-->server3 master
server1 slave-->server4 master

These servers are for redis alone, so I can allot upto 22 GB memory for redis.

But I am not sure how to setup maxmemory for these instances. Do I need to set it at 11 GB on master and slave each, on each server? Or I need to set it to 22 GB for both servers?

Also, what would be the overall memory available for data on redis, 22*4 = 88GB, or 22 GB only?


Solution

  • Since your master and slave are located on the same server, you should set maxmemory to 11GB for each master and slave. Also, the overall memory available for the cluster is 11 * 4 = 44G.