Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a description about replica_affinity option for cluster gem #1150

Conversation

supercaracal
Copy link
Contributor

@supercaracal supercaracal commented Sep 7, 2022

closes #1067

I added a new feature to redis-cluster-client that we become able to specify the strategy for reading from replicas. I tried to simulate the environment of multiple availability zones with the tc command.

near node:

PING 172.18.0.5 (172.18.0.5) 56(84) bytes of data.
64 bytes from 172.18.0.5: icmp_seq=1 ttl=64 time=0.049 ms
64 bytes from 172.18.0.5: icmp_seq=2 ttl=64 time=0.052 ms
64 bytes from 172.18.0.5: icmp_seq=3 ttl=64 time=0.041 ms
64 bytes from 172.18.0.5: icmp_seq=4 ttl=64 time=0.039 ms
64 bytes from 172.18.0.5: icmp_seq=5 ttl=64 time=0.056 ms

far node:

PING 172.18.0.4 (172.18.0.4) 56(84) bytes of data.
64 bytes from 172.18.0.4: icmp_seq=1 ttl=64 time=2.13 ms
64 bytes from 172.18.0.4: icmp_seq=2 ttl=64 time=2.07 ms
64 bytes from 172.18.0.4: icmp_seq=3 ttl=64 time=2.07 ms
64 bytes from 172.18.0.4: icmp_seq=4 ttl=64 time=2.06 ms
64 bytes from 172.18.0.4: icmp_seq=5 ttl=64 time=2.15 ms

replica_affinity: :random

BenchCommand::ScaleReadRandom#bench_get = bench_get	 0.000531	 0.027782	 0.103212	 1.216746	12.433569

replica_affinity: :latency

BenchCommand::ScaleReadLatency#bench_get = bench_get	 0.000344	 0.001310	 0.008482	 0.086164	 0.762670

@supercaracal supercaracal marked this pull request as ready for review September 7, 2022 12:02
@byroot byroot merged commit c7adca2 into redis:master Sep 7, 2022
@supercaracal supercaracal deleted the add-replica-affinity-option-to-cluster-client branch September 7, 2022 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prioritize replica node
2 participants