[Twisted-Python] twisted run out of file descriptors

Alec Matusis matusis at matusis.com
Tue Oct 26 00:40:09 EDT 2004

I am running twisted on 2.4.21 Kernel.

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?

Sample Errors:


internet/default.py", line 487, in doSelect
[], timeout)
exceptions.ValueError: filedescriptor out of range in select()

2004/10/25 16:35 PDT [-] Malformed file descriptor found. Preening
2004/10/25 16:35 PDT [-] bad descriptor


Alec matusis

More information about the Twisted-Python mailing list