[Twisted-Python] twisted run out of file descriptors

Tommi Virtanen tv at twistedmatrix.com
Tue Oct 26 03:25:08 EDT 2004

Alec Matusis wrote:

>My chat server has been puking and dying the last couple days and it
>seemed pretty clear that it was dying when it was reaching 1024 open
>file descriptors.
>I noticed the default ulimit -n was 1024, so I added a 'ulimit -n
>4096' before starting the chat server. That has apparently allowed it to
>1024 descriptors (it has 1263 at the moment) but now it is failing to
>call select (see sample errors below).
>There is this value
>FD_SETSIZE in the C headers that determines the maximum number of
>sockets a proc can select() on, and it's set to 1024. It it possible to
>increase this limit, short of recompiling the Kernel?
Yes (in some libcs) but you don't want to play with that thing. Switch 
to pollreactor.
Poll has no builtin limits, but will start to get slow after a few 
thousand fds.

But, do you know why your app has over a thousand fds open? If there's 
no really
good reason, you have a leak and should fix that. A thousand fds is 
quite a lot.

More information about the Twisted-Python mailing list