Tuesday, March 23, 2010

Resolve around File Descriptor limited on Reactor Select (selector)

I've been running into problem file descriptor run out using the default reactor. By default, twisted got hardcode the file descriptor to be 1024 (MAX). If you want to change the default MAX need to modify code and recompile. Or we can use the pollreactor to increase several thousand more.
from twisted.internet import pollreactor
usage as normal:
from twisted.internet import reactor

Even if you change the ulimit on filesystem, it doesn't change with the library. This is something hardcode inside twisted lib.

No comments:

Post a Comment