Page MenuHomeFreeBSD

Limit openfiles-cur to 1024

Authored by trasz on Wed, Nov 27, 11:09 PM.



Limit the default soft limit of opened file descriptors to 1024.
A lot of software developed for systems without closefrom(2) loops
trying to close all file descriptors from N to the rlimit, all
58977 of them, one syscall per nonexistent fd.

Note that this does not affect the hard rlimit - the process can still
raise the soft limit using setrlimit(2). They do use it, since they are
usually being developed under distributions which set the limit the
exact same way.

Diff Detail

rS FreeBSD src repository
Lint OK
No Unit Test Coverage
Build Status
Buildable 27824
Build 26003: arc lint + arc unit

Event Timeline

trasz created this revision.Wed, Nov 27, 11:09 PM
trasz edited the summary of this revision. (Show Details)Wed, Nov 27, 11:12 PM
trasz added a reviewer: kevans.
kevans accepted this revision.Wed, Nov 27, 11:13 PM
This revision is now accepted and ready to land.Wed, Nov 27, 11:13 PM
allanjude accepted this revision.Thu, Nov 28, 3:09 AM
allanjude added a subscriber: allanjude.

Reviewed by: allanjude

swills added a subscriber: swills.Mon, Dec 2, 6:41 PM

Not a fan of this, personally. This default limit on Linux results in a lot of people hitting the limit, being confused, others documenting how to raise it and the first group searching for how to raise it. Doesn't seem like the best idea to have our users have to do that too. I get the motivation, but would rather have close_range or fdwalk. But again, that's just my personal opinion.