Hi everyone, Excuse me jumping on the bandwagon, but I was thinking of doing something slightly different and would be keen to hear everyone's thoughts.
The plan was to create a Riak client connection for every request coming in (maintained for the lifetime of the request). That connection would connect to any one of the nodes in the Riak cluster (via some simple algo such round-robin). I was also thinking of building something into this mechanism which would be able to manage an open list of potential target nodes to connect to and handle when new nodes join the cluster or when nodes go offline in an effort to make sure that the web application will "always" know of a valid node to connect to. Does this seem like overkill? Would the effort in implementing such behaviour be worth the reward? Many thanks for any insights. OJ On Sun, Sep 5, 2010 at 7:59 AM, Seth Falcon <s...@userprimary.net> wrote: > On Sat, Sep 4, 2010 at 7:18 AM, Justin Sheehy <jus...@basho.com> wrote: > > Hello, Senthilkumar. > > > > On Fri, Sep 3, 2010 at 4:28 PM, Senthilkumar Peelikkampatti wrote: > > > >> I am using Riak with distributed Erlang and I wanted to know > what's > >> the limit on # of riak clients (I used it before erlang pb client, so > yet to > >> migrate). I am using single client to talk to Riak, is it better? or in > web, > >> is it ok to create a client per request? I looked riak_kv_wm_raw.erl > which > >> seems using a connection per request but it is a erlang local_client. > > > > There is not a fixed limit imposed by Riak, but it is a general good > > practice to re-use clients for subsequent (non-concurrent) requests. > > I'm working on a project where we have a webmachine-backed service > that talks to Riak. I currently initialize one pb client for each > node in the cluster as part of the webmachine startup. Then the > resources in the webmachine app ask for one of these clients for each > request. > > Your comment above about reusing clients for non-concurrent requests > makes me wonder if this is the wrong approach. Comments or > suggestions? > > Thanks, > > + seth > > -- > Seth Falcon | @sfalcon | http://userprimary.net/ > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > -- OJ Reeves http://buffered.io/
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com