Can I use twemproxy for load balancing by redis queue size?

321 views Asked by At

Can I use twemproxy as a load balancer for a pool of redis instances, according to size of redis queue (amount of keys per instance)? Is twemproxy able to turn off from the upstream one of the redis instances, if it reaches a preconfigured maximum amount of keys in it's database?

If so, how can I do that (I'm very new to redis and stuff, so I just possibly don't get this from documentation)?

Thanks in advance.

1

There are 1 answers

6
udondan On BEST ANSWER

No, it is not possible to loadbalance on the exact number of keys or queue size per instance. The sharding is based on calculations based on the key name. (see hash, hash_tag and distribution settings) Usually you should get a pretty even distribution but with some bad luck some shards might get much more keys than others.