Load balancing READs over all replicas

459 views
Skip to first unread message

Jakub Liska

unread,
Feb 2, 2017, 3:29:44 AM2/2/17
to Redis DB
Hey,

when cluster-mode is disabled (no sharding), how is READ load distributed among all nodes? Primary and replicas?

Considering the fact that redis client makes connection to a single entry point, do all READ request hit Primary node first and then being redirected to a slave in a round-robin fashion, or how is this done exactly ? 

I'm using Rediscala client and it doesn't seem to be establishing connections to the replicas, only to the the primary node.

Jan-Erik Rediger

unread,
Feb 2, 2017, 3:42:31 AM2/2/17
to redi...@googlegroups.com
Redis does not handle load balancing or redirection at all.
Your client would need to directly talk to read-only slaves.
> --
> 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 post to this group, send email to redi...@googlegroups.com.
> Visit this group at https://groups.google.com/group/redis-db.
> For more options, visit https://groups.google.com/d/optout.

hva...@gmail.com

unread,
Feb 2, 2017, 4:23:39 AM2/2/17
to Redis DB
Redis does not offer a load balancing service.  Only the back-end database.

If you use Sentinel to monitor the non-cluster Redis servers, the client programs connect to Sentinel and ask for the master Redis server and the slave Redis servers.  That's one way the client programs can learn the list of slave servers.  The client programs would still have to pick a slave from the list and connect to it, using a selection method that will tend to spread the connections among the slaves.

CharSyam

unread,
Feb 2, 2017, 4:39:00 AM2/2/17
to redi...@googlegroups.com
Yes, If you want to read from slaves.
You should implement your business logic like below.
make redis connection for slave.
and when you want to send read request.
using read connection.
Reply all
Reply to author
Forward
0 new messages