[Twisted-Python] Reactor Spinning?

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Tue May 4 15:42:40 MDT 2010


On 01:48 pm, moxie at thoughtcrime.org wrote:
>
>Hey Twisted folks,
>
>I'm using the twisted.web framework for a high performance HTTP proxy
>server that very closely resembles the HTTP proxy server example that
>comes with the twisted package.
>
>Under heavy load, I occasionally run into a problem where the reactor
>appears to start spinning on an "empty" write.  An strace of the 
>process
>reveals these system calls:
>
>epoll_wait(3, {{EPOLLOUT, {u32=81, u64=13194703840475086929}}}, 269, 8) 
>= 1
>write(81, "", 0)                        = 0

It might be interesting to learn what's in the reactor that's associated 
with this file descriptor and what the state of its send buffer is. 
Some strategically placed log messages might help with that, or a 
manhole in the process that you can connect to when you notice the 
problem has started in order to poke around.

Jean-Paul




More information about the Twisted-Python mailing list