[Twisted-Python] Twisted Consumes 100% CPU

Matthew Glubb matt at madebykite.com
Sun Feb 24 05:48:37 EST 2008

Hi All,

Hope you are all enjoying your weekends.

I have a simple twisted proxy server, obviously passed on  
twisted.web.proxy. Periodically, it makes a call to a MySQL database,  
using adbapi.ConnectionPool.

When I initially boot the server, I see traffic going through the  
proxy and everything works fine, twistd consumes less than 5% CPU. I  
return 24 hours later, the server is still responsive (ie. functions  
fine) but it consumes 100% of the CPU.

I have only noticed this behaviour since I added the db connection  
via adbapi. I assume, because the proxy still functions well that the  
threads in the adbapi pool are working overtime.

When I manhole in to the server, gc.collect() shows objects are being  
cleaned up, and gc.garbage reports nothing.

I am running Twisted 2.5, Python 2.5.1, Linux 2.6, epoll, MySQL 5.0.51a.

Does anyone have any experience of this problem? Is there an easy  

Thanks for your time :)


Matthew Glubb
Technical Partner

email: matthew.glubb at madebykite.com
phone: 44 (0) 7715 754017
skype: mglubb


GPG: 96FF DE0E 0B7B 37F0 7F8D C54C E285 3D8F 5625 9244

More information about the Twisted-Python mailing list