[Twisted-Python] Twisted as a full solution for web hosting [WSGI + other]

Matt Haggard haggardii at gmail.com
Tue Oct 22 06:52:21 MDT 2013


On Tue, Oct 22, 2013 at 6:38 AM,  <exarkun at twistedmatrix.com> wrote:
[snip]
>
> It will produce roughly the same results as you'd get if you used any other
> WSGI container: one of the threads in the thread pool will be kept
> unavailable as it waits for the result.  This will have the usual
> consequence: if your threadpool has a max of N threads and you receive N
> requests that need to do this, the N+1th request that needs to be handled by
> the WSGI part of your server won't be handled until one of the previous
> requests completes (completion frees up one thread which is then used to
> handle the N+1th request).
[snip]

It is "roughly" the same, but it may also be better.  We recently
replaced flup with Twisted as our WSGI container.  With traffic
spikes, flup would start dropping requests because our WSGI app is too
slow, resulting in 500 errors for our users.  With Twisted as the WSGI
container, we no longer see the same 500 errors.  Eventually, all
requests finish.  I recommend Twisted as a production WSGI container.

Matt Haggard



More information about the Twisted-Python mailing list