Load Balancing With Riak Ruby Client

Sean Cribbs sean at basho.com
Fri May 27 15:40:08 EDT 2011


This is one thing I desperately want to refactor. The Ruby client still contains some things that reflect my earlier, less astute understanding of how a Riak client should behave and doesn't include obvious things like retrying requests (possibly on other nodes), conflict resolution strategies, and mutators.

In the past, I have recommended that users put a lightweight load-balancer (e.g. haproxy, pound) between their application and Riak, and simply have the app connect to the locally-running instance of the LB.  I realize this is not a great solution, but it also avoids a little NIH for now.

Sean Cribbs <sean at basho.com>
Developer Advocate
Basho Technologies, Inc.
http://basho.com/

On May 27, 2011, at 3:20 PM, Keith Bennett wrote:

> Hi, all.  If I have several riak servers on a cluster, and want to distribute load fairly evenly, and am using the Ruby Riak client, what is the best way to balance load?
> 
> With the HTTP interface, I can randomize the choice of host for a request.  How would I do the same with the ruby client?  Would I create a Riak::Client for each host, and then just randomize the selection of those for a given call?  Do the clients contain any state that would make this a bad idea?  Or is there a better way to do this?
> 
> Thanks,
> Keith
> 
> 
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com





More information about the riak-users mailing list