Repository navigation
Can read/write separation be implemented? #1778
Unanswered
tianshr123
asked this question in
Q&A
Replies: 1 comment
|
Yes, rdb := redis.NewClusterClient(&redis.ClusterOptions{
Addrs: addrs,
RouteRandomly: true, // or RouteByLatency: true
})
Keep in mind that replication is asynchronous, so a read right after a write can return stale data. For reads that must see the latest write, use a separate client without these options. This only moves read load: if the master is at 100% CPU because of writes, you need more shards instead. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I have a cluster environment and the current data access traffic is extremely high. As a result, the Redis CPU usage of the master node reaches 100%. Is there any method to load some query requests to the standby node for execution?
All reactions