[uWSGI] python wsgi application is imported before forking worker process ?

Roberto De Ioris roberto at unbit.it
Fri Oct 25 07:44:10 CEST 2013

> Today we found a strange bug in my application when deployed with uwsgi.
> It
> turns out that our application created some tcp connections and store them
> in a pool at import time, and we found that different worker processes
> shared the same connections, which cause some strange behavior.
> I guess this is because uwsgi fork worker processes after import python
> application, so the file descriptors created at import time are shared
> among worker processes.
> I wonder is this behavior normal? If it is normal, then what is the
> recommended way to do initialization related to file descriptors.
> Thanks.

--lazy-apps and --lazy changes the way applications are loaded:


Roberto De Ioris

More information about the uWSGI mailing list