riakpool in production

Ryan Zezeski rzezeski at basho.com
Tue Apr 12 22:38:51 EDT 2011


Dave,

First off, I want to say that I think it's awesome that you've started a
riakc pool implementation and shared it with everyone!  It's certainly a
missing piece and we could all benefit from having a canonical
implementation.  That said, I have a few comments:

1) Growth of the pool: Since the pool has no ceiling things could get out of
control under the right conditions.  Just as important, I don't see any
functionality to shrink the pool when things are quiescent (default behavior
of riakc is to not timeout the conn).  Also, you may want to grow by more
than 1 to handle spikes better.

2) Concealing errors:  I like how you made a HOF (execute) to deal with conn
checkin/checkout but I don't like how it covers up the cause of an error, I
would let it escape.  E.g. if someone fat fingers the module name they will
get 'error' back instead of the much more helpful 'undefined ...'.

3) Wrapping the return value: You wrap the return val like `{ok,F(C)}`.  I'd
just return the value of F(C) so existing clients don't have to change their
patterns.  Plus `{ok,{ok,Obj}}` feels funny.

Anyways, these are just some thoughts after browsing the code a little.  I'm
no expert in building conn pools--not even a beginner for that matter.  I
think it's a good start and I hope you continue working on it and improving
it.  I may even send some pull requests your way in the future.

Please keep us updated on your use of Riak in production.  It's always nice
to hear :)

Thanks,
-Ryan

P.S.  I've been wanting to checkout mailrank's Haskell pool.  Those darn
Haskell folks always seem to build good stuff.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110412/1d84cee2/attachment.html>


More information about the riak-users mailing list