Ideal VM size for a redis cluster

469 views
Skip to first unread message

Prathik Rajendran M

unread,
Jun 20, 2021, 11:40:27 PM6/20/21
to Redis DB
Hi All,

What would be an ideal VM size for a redis cluster?

I am considering two options

1. 8 cpu core machine with multiple redis processes running
- Pro
Faster replication to replicas since they are in the same machine
- Con
A machine going down could lead to a large block of the cluster getting affected

2. 2 cpu core machine with a single redis process running
- Pro
Easier to setup
Possible higher availability
- Con
Replication could be slower
Network issues could affect the cluster more

What would be an ideal candidate? What mental models or framework should we use to decide the right VM cpu cores? If it helps we are on GCP.

Thanks

Mehedi Hasan

unread,
Jun 21, 2021, 1:46:45 AM6/21/21
to redi...@googlegroups.com
Disclaimer: Opinions are all derived from experience of experimenting with different set up.

Hi,
Though Redis is single threaded by nature it often forks threads for some activity like bgsave etc. (especially when to interact with disks or IOs). So personally I always put at least 4 cpu in each redis server. 

Next,  I don't put all Redis processes of a single cluster in a single VM. It violates the principles of partition tolerance. So if a cluster has 3 processes I put those 3 in different servers.

Saying that occasionally I had put 5 processes in 3 servers sacrificing some amount of HA and saving some server maintenance overhead. It may not save any cost and sometimes bring an IO bottleneck if not maintained properly. 

Finally, I often set multiple processes of different clusters in the same VM. For example, if I have to set up 2 clusters I would use 3 VMs with 2 redis containers in each VM in different ports, rather than using 6 VMs. This gives less overhead on server management but we need to be more careful about the server resources. In these scenarios, I have experimented that often 6 cpu is sufficient in each machine (rather than 8) as many operations are scheduled at different times at the OS layer.



--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/redis-db/5a66ac0a-bbf5-4d06-a48d-ab02752c152dn%40googlegroups.com.

Manish Arora

unread,
Jun 23, 2021, 10:48:39 AM6/23/21
to Redis DB
Parthik,

Here is link to a reference architecture you could consider: 

My assumption is that the depicted architecture outlines distinct VMs, separate physical servers and racks. Where, the racks have dual power/cooling feeds, and racks are not physically co-located. 

I am sure you are thinking what about the network resiliency, and the network latency. 

The typical latency of a 1 Gbit/s network is about 200 us, while the latency with a Unix domain socket can be as low as 30 us. For latency centric details, you can dig through this article: https://redis.io/topics/latency

Lastly, here are some additional details on recommended practices in terms of sizing your machine (core, RAM)

Hopefully this is helpful

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

Reply all
Reply to author
Forward
0 new messages