Redis cluster Vs Single Node Performance Difference

895 views
Skip to first unread message

Astro

unread,
Aug 20, 2018, 9:23:22 AM8/20/18
to Redis DB
I am using redis-benchmark to compare performance b/w single redis node with a slave Vs a redis cluster with 3 masters and 3 slaves.


Case 1: The ./redis-benchmark -h single_node_master_host -p port -n 1000000 -t ping - ~46K ops


Case 2: ./redis-benchmark -h master_1_host -p port -n 1000000 -t ping - ~32K ops
             ./redis-benchmark -h master_2_host -p port -n 1000000 -t ping - ~30K ops
             ./redis-benchmark -h master_3_host -p port -n 1000000 -t ping - ~31K ops


The benchmarks in case 2 are run from 3 different machines to avoid resource contention issue.

What are the possible causes of this performance different b/w single redis instance Vs nodes in redis-cluster?


hva...@gmail.com

unread,
Aug 21, 2018, 12:31:53 PM8/21/18
to Redis DB
Are you ensuring the Case 2 redis-benchmark programs are each generating keys that will stay on the shard of their designated master?  If they generate keys that belong to a different master, the commands for those keys will receive an error suggesting they be submitted to the correct master, and the write/error/write sequence is slower than the usual write/ok sequence.  https://redis.io/topics/cluster-tutorial has some coverage of how to use "hash tags" to ensure keys are on the same master.

Another possibility that comes to mind is whether your redis-bendhmark is using the WAIT command (also discussed in the cluster-tutorial) to delay receiving the response to write commands until the write has been replicated to the slave.  This can also make writes slower as it makes them safer.

My guess is that the first possibility is the more likely cause.

Astro

unread,
Aug 21, 2018, 12:35:06 PM8/21/18
to Redis DB
The case described here only uses PING.

 

Astro

unread,
Aug 21, 2018, 12:35:40 PM8/21/18
to Redis DB

hva...@gmail.com

unread,
Aug 22, 2018, 11:54:07 AM8/22/18
to Redis DB
PING performance will depend on the network performance between the client and server machines (as will most Redis commands).
Have you measured the TCP network latency from your redis-benchmark client machines to all four of your redis master machines? (both Case 1 and Case 2)

Have you checked the possibilities mentioned in https://redis.io/topics/latency ?
Reply all
Reply to author
Forward
0 new messages