I&#39;ve been prototyping a client that connects to thousands of servers and calls some method. It&#39;s not real important to me at this stage whether that&#39;s via xmlrpc, perspective broker, or something else.<br><br>What seems to happen on the client machine is that each network connection that gets opened and then closed goes into a TIME_WAIT state, and eventually there are so many connections in that state that it&#39;s impossible to create any more.<br>
<br>I&#39;m keeping an eye on the output of<br>netstat -an | wc -l<br>Initially I&#39;ve got 569 entries there. When I run my test client, that ramps up really quickly and peaks at about 2824. At that point, the client reports a callRemoteFailure:<br>
<br>callRemoteFailure [Failure instance: Traceback (failure with no frames): &lt;class &#39;twisted.internet.error.ConnectionLost&#39;&gt;: Connection to the other side was lost in a non-clean fashion: Connection lost.<br>
<br>Increasing the file descriptor limits doesn&#39;t seem to have any effect on this.<br><br>Is there an established Twisted sanctioned canonical way to free up this resource? Or am I doing something wrong? I&#39;m looking into tweaking SO_REUSEADDR and SO_LINGER - that sound sane?<br>
<br>Just tapping the lazywebs to see if anyone&#39;s already seen this in the wild.<br><br>Thanks guys<br><br>Donal<br>