Uwsgi+flask+boto - Thread Safety
Say I have a Flask application, served by uWSGI using multiple processes, like: uwsgi --socket 127.0.0.1:3031 --file flaskapp.py --callable app --processes 4 And my Flask app is o
Solution 1:
Since you haven't enabled threads in uWSGI (see: --enable-threads
, --threads
) there's no Python threading going on here (in Boto or otherwise.)
I would recommend using --lazy
, which will cause your app to be loaded in each worker post-fork. Then you can simply rely on that behavior to ensure each worker has the appropriate connections/pools/etc. available without the concerns of shared state.
Post a Comment for "Uwsgi+flask+boto - Thread Safety"