You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using RedisCluster with read_from_replicas=True to offload read operations from the master nodes to replicas. However, we have observed that even with this setting enabled, RedisCluster is still sending some read requests to master nodes instead of strictly using replicas.
Upon checking the source code, we found that the LoadBalancer class is responsible for distributing the requests across both master and replica nodes. This behavior is unexpected as the expectation with read_from_replicas=True is that all read operations should strictly go to the replicas.
Impact on Our Setup
We handle heavy read/write operations with 100Cr+ (10 billion) reads and writes daily.
This issue increases load on master nodes, affecting both write and read latencies.
Replicas are not being fully utilized as expected.
Expected Behavior
When read_from_replicas=True is set, all read requests should only go to replica nodes, and master nodes should be used strictly for write operations.
Observed Behavior
Reads are distributed between both master and replica nodes, likely due to how the LoadBalancer class assigns nodes.
This issue affects high-scale production workloads where strict read/write separation is necessary for performance optimization.
The text was updated successfully, but these errors were encountered:
@akshitsaini1 Hey, thanks for reaching us out! I agree that this naming is misleading, I would say we need to support different strategies, current strategy is more like a round-robin and we need read from replicas only. We would start work on this soon.
Thank you for the quick response! I appreciate the clarification regarding the current strategy. That makes sense.
Could you please share if there’s a planned version where this change might be introduced? This would help us plan accordingly on our end. Looking forward to the update!
Fixed with PR #3563.
The fix doesn't change the exposed property meaning or effect, but 'read_from_replicas' is now deprecated.
With this PR, we are introducing another property allowing the user to select which concrete load-balancing strategy should be used.
We are using
RedisCluster
with read_from_replicas=True to offload read operations from the master nodes to replicas. However, we have observed that even with this setting enabled, RedisCluster is still sending some read requests to master nodes instead of strictly using replicas.Upon checking the source code, we found that the LoadBalancer class is responsible for distributing the requests across both master and replica nodes. This behavior is unexpected as the expectation with
read_from_replicas=True
is that all read operations should strictly go to the replicas.Impact on Our Setup
Expected Behavior
When read_from_replicas=True is set, all read requests should only go to replica nodes, and master nodes should be used strictly for write operations.
Observed Behavior
Reads are distributed between both master and replica nodes, likely due to how the LoadBalancer class assigns nodes.
This issue affects high-scale production workloads where strict read/write separation is necessary for performance optimization.
The text was updated successfully, but these errors were encountered: