[uWSGI] Problem with multiple processes with httplib.HTTPConnection?

Roberto De Ioris roberto at unbit.it
Tue Nov 9 18:05:22 CET 2010

Il giorno 09/nov/2010, alle ore 17.39, Alan Castro ha scritto:

> Roberto,
> I'm still facing this problem. 
> Let me context my problem: I developed a Pylons application (which is multithreaded, each request fires up a new thread) and is working fine (deployed with uwsgi with one process). When I run it on a multiprocess with uwsgi eveything goes out of control and I keep getting this Oracle error TNS: Bad packet, which looks like problem with my sqlalchemy session object.
> I know this runs a bit out of uwsgi context, but do you know how much uwsgi multiprocess environment affects pylons multithreaded? In my head everything should work fine.

I suppose that your app generate a new python thread at every request that do something in the background and pass data to the "main" thread that will send the response to the webserver; in this case, have you enabled the -T option ?
Without it the GIL is not initialized and i do not know what could happen :)  If instead your app generate a new thread that "alone" manages the whole request
(so the thread itself generate the wsgi response) this will cause all sort of problems, as the current uWSGI stable releases are not multithreaded (you have to use
a 0.9.7-dev release from mercurial repository)

Roberto De Ioris

More information about the uWSGI mailing list