Riak Python Client: How to properly use/re-use the client object?

Finkle Mcgraw finklemcgraw at gmail.com
Wed May 7 03:53:44 EDT 2014


Hi fellow Riak users,

Background:

I have a website project in which I'm using a set-up of a few stateless
webservers which talk to the riak cluster via HAProxy over HTTP. Each
webserver has a HAProxy instance locally which knows about the nodes in the
riak cluster, so the application itself only talks to localhost, i.e., the
python riak client is instantiated with only one "node" (localhost).

The app is implemented using Flask and Gunicorn, and each webserver has
four gunicorn processes handling incoming requests.

Question:

Should I re-create a client object the first thing I do when processing a
request, or can I re-use the client object in between requests?

Currently I'm using the latter approach, which is not working very well,
especially if one of the nodes goes offline (the python client then raises
an exception instead of retrying internally).

BR Finkle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20140507/a0b422c5/attachment.html>


More information about the riak-users mailing list