Riak Python Client: How to properly use/re-use the client object?
finklemcgraw at gmail.com
Wed May 7 03:53:44 EDT 2014
Hi fellow Riak users,
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.
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).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the riak-users