[Web-SIG] WSGI multi threading indications?

Phillip J. Eby pje at telecommunity.com
Mon Jan 8 23:02:08 CET 2007


At 12:54 PM 1/8/2007 -0800, Foobar BazBaz wrote:
>Yes... that's it exactly.  Looking at the code, it
>appears
>that subclassing WSGIRequestHandler, overriding the
>handle
>method to dispatch to one of a pool of handler threads
>might be an easy way to get reasonalble performance
>from this still-simple approach.
>
>At least it *looks* to me like handle method would be
>the place to make the transfermation to
>thread-per-request.

No, that's the place where you'd change it to set wsgi.multithread to 
False.  :)

If you want to make it *actually* multithreaded, you need to subclass 
WSGIServer and mix in SocketServer.ThreadingMixIn, e.g.:

    class MultiWSGI(ThreadingMixIn, WSGIServer):
        ...




More information about the Web-SIG mailing list