librelist archives

« back to archive

uwsgi + nginx + flask + sqlalchemy

uwsgi + nginx + flask + sqlalchemy

Michael Rau
2014-02-05 @ 20:48
Hello people,

I observe a strange situation with uwsgi + nginx + flask + sqlalchemy. In
production mode I am running uwsgi with 4 processes and 2 threads. This
application obviously uses simple forms. Now if I make a change to some
form content, committing this into the database everything is fine. But
triggering a reload in the browser brings up the old value. Reloading again
and again brings up the new value. This goes round in circles and it very
much seems to be related to the processes/threads. If I set uwsgi to 1
process, this behaviour does not occur.

BTW: I am using scoped sessions.

What am I missing here?

Any help very much appreciated.