<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Apr 26, 2011, at 11:42 AM, Juan Antonio Ibaņez Santorum wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>&nbsp;&nbsp; I have a Linux box serving my twisted app. All works ok except after some days running (where I can see my CPU going to 100%). I saw that CPU goes 100% usage when the app reaches to 1024 opened&nbsp;descriptors&nbsp;(sockets). It seems TM isn't closing some connections when clients loose connection to the server. I have no more than 200 simultaneous clients, each of then using a single connection. Any idea why those connections remain open?</div>
</blockquote><br></div><div>This is a bug that somebody should really fix. &nbsp;&lt;<a href="http://tm.tl/816">http://tm.tl/816</a>&gt;</div><div><br></div><div>To work around it, however: if a connection is closed "uncleanly" (for example: you close your laptop, you rip the ethernet cable out of the wall, you&nbsp;<a href="http://www.youtube.com/watch?v=ztbIwH7gz7o">foolishly give your computer to zooko for a minute</a>), and no traffic is going in either direction, it will remain "open" as far as the server is concerned, forever.</div><div><br></div><div>If you send a little bit of traffic (an application-level ping) to each client every so often, the server's TCP stack will notice that nobody is acknowledging it and eventually time them out and close the connections.</div><div><br></div><div>Alternately, you could fix an even older bug, &lt;<a href="http://tm.tl/78">http://tm.tl/78</a>&gt;, which would allow you to immediately terminate "dead" connections without waiting for them to time out.</div><div><br></div><div>Good luck,</div><div><br></div><div>-glyph</div><div><br></div></body></html>