Hi,

I'm trying to use poolboy to organize a pool of connections to riak
nodes with protobuf client.

This has come from the suggestion here:
http://lists.basho.com/pipermail/riak-users_lists.basho.com/2012-September/009346.html

The quote:
"Using Poolboy is convenient because it comes as a dependency of
riak_core.

If you use Poolboy, you'll have to modify riakc_pb_socket slightly to
account for the way poolboy initializes connections (add a start_link/1),
or create a simple module to pass the initialization from poolboy to
riakc_pb_socket."

What I'm pondering about is what would be a convenient way to start
riakc_pb_socket clients in a pool.
For example, if I have 10 riak nodes in a cluster and want to open a
single connection to each of them (using riakc_pb_socket), I need one
poolboy worker per one riakc_pb_socket instance. In this case, I need
a host/port of a single riak node for each
riakc_pb_socket:start_link(). So I use WorkerArgs in
poolboy:start_link/3 to pass a list of riak nodes. And here comes a
confusion. poolboy passes WorkerArgs to each of its workers, so each
worker gets the list of riak nodes. Now I need to somehow choose a
node, maybe like proposed here:
https://github.com/basho/riak-erlang-client/pull/45/files
But I don't think it's a good solution.

Maybe my idea of using riakc_pb_socket together with poolboy is not
convenient? Maybe I should start a pool per each riak node? Maybe
poolboy is not that convenient in this case as it seems?

Would you share your experiences and thoughts on the subject?

Thank you.

_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to