[Web-SIG] WSGI multi threading indications?

Robert Brewer fumanchu at amor.org
Mon Jan 8 19:08:22 CET 2007


Foobar BazBaz wrote:
> I'm using wsgiref.simple_server running behind Apache.
> (Created using wsgiref.simple_server.make_server)
> 
> I see:
>   wsgi.multiprocess is False
>   wsgi.multithread is True
>   wsgi.run_once is False
> 
> I'm surprised by the value of multithread, since it
> appears (and looking at the code seems to verify) that
> additional threads are never created; i.e. the server
> synchronously handles one request at a time.
> 
> Am I missing something?  It there a better choice for
> an out-of-the box server to work in an WSGI
> environment?

There's no better choice for that particular reason. ;) You'll have to manually tell any WSGI server what environment it's running in, because mod_proxy/mod_rewrite doesn't include that metadata by default. There's probably a way to send a custom header from Apache up to the WSGI server, but that would be by convention only (at this point).

If you use mod_python (3.1 or better) instead of proxy/rewrite, you can inspect apache.mpm_query(apache.AP_MPMQ_IS_THREADED) and apache.mpm_query(apache.AP_MPMQ_IS_FORKED) as http://projects.amor.org/misc/wiki/ModPythonGateway does.


Robert Brewer
System Architect
Amor Ministries
fumanchu at amor.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/web-sig/attachments/20070108/9d7af2fa/attachment.htm 


More information about the Web-SIG mailing list