[Twisted-Python] too many file descriptors on win2003 server

Itamar Shtull-Trauring itamar at itamarst.org
Fri Jun 24 11:25:02 EDT 2005

On Fri, 2005-06-24 at 11:34 +0200, Patrick Lauber wrote:

> I have a server that acts as a Flash-XML-Socket Server that pushes data 
> to the clients in a irregular interval. It is running on win2003 server 
> and i get the "too many file descriptors in select()" error when i hit 
> the 512 mark. Is there a way to extend this limit? the poll reactor 
> doesn't seam to work under win. is the win32 reactor better at large 
> simultaneous connections?

No, win32eventreactor is worse, it only does 64. The 512 limit comes
from Python, it #defines FD_SETSIZE to be 512 in the C socket extension
module; the default without this would have been 64 as well.

Your options: 

1. Compile your own version of the _socket.pyd for Windows, patched to
have a higher FD_SETSIZE.

2. Try the IOCP reactor, it might work, and certainly shouldn't have
limits on number of sockets.

more aggressive timeouts on client connections should help somewhat as
well, though they don't solve the real issue.

More information about the Twisted-Python mailing list