Page MenuHomeFreeBSD

Increase FD_SETSIZE from 1024 to 4096
Needs RevisionPublic

Authored by allanjude on Jun 10 2016, 12:36 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 2 2024, 6:48 PM
Unknown Object (File)
Dec 20 2023, 3:43 AM
Unknown Object (File)
Nov 29 2023, 2:13 AM
Unknown Object (File)
Nov 28 2023, 11:58 PM
Unknown Object (File)
Sep 25 2023, 3:55 AM
Unknown Object (File)
Sep 20 2023, 7:33 PM
Unknown Object (File)
Jul 17 2023, 8:41 PM
Unknown Object (File)
Jun 28 2023, 12:27 PM
Subscribers

Details

Reviewers
cem
Summary

FD_SETSIZE is the maximum FDs that you can call select() on at once

Increasing this value allows applications to have a larger working set
of file descriptors, and more efficiently monitor a large set of FDs.

Submitted by: Sean Kelly <smkelly@freebsd.org>
Relnotes: Yes

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4169
Build 4212: arc lint + arc unit

Event Timeline

allanjude retitled this revision from to Increase FD_SETSIZE from 1024 to 4096.
allanjude updated this object.
allanjude edited the test plan for this revision. (Show Details)
cem requested changes to this revision.Nov 8 2017, 7:50 PM
cem added a subscriber: cem.

Nak :-). If you're running into the 1k fd limit with select(), you shouldn't be using select. If you're monitoring just a few high-number fds, poll() might be a suitable replacement. Otherwise, running into this limit is a good reminder to use kqueue.

IIRC, Isilon has some local patches to FD_SET() to abort the program if the given fd would exceed FD_SETSIZE, rather than corrupting memory. That might be a good idea for FreeBSD, in theory.

This revision now requires changes to proceed.Nov 8 2017, 7:50 PM