Skip to content

fs: raise default max file descriptors from 16384 to 65536 - #1485

Open
gburd wants to merge 1 commit into
cloudius-systems:masterfrom
gburd:pr/fd-limit-highvu
Open

fs: raise default max file descriptors from 16384 to 65536#1485
gburd wants to merge 1 commit into
cloudius-systems:masterfrom
gburd:pr/fd-limit-highvu

Conversation

@gburd

@gburd gburd commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

The default fs_max_file_descriptors is 0x4000 (16384), which sizes the global file-descriptor table in fs/vfs/kern_descrip.cc. Server workloads that keep many files and sockets open concurrently can exhaust this table and hit EMFILE, at which point the affected component typically aborts rather than degrades.

This was observed with a database under high connection count: each backend accumulates open relation files, WAL segments, and client sockets, and a busy sweep drives the live fd count past 16384, producing EMFILE in the WAL writer and an abort.

Raise the compile-time default to 0x10000 (65536). It remains a configurable Kconfig value, so images that want the smaller table can set it back. The table is an array of pointers, so the extra headroom costs a few hundred KB of kernel memory at most.

Standalone change, no dependencies.

The default fs_max_file_descriptors is 0x4000 (16384), which sizes the
global file-descriptor table in fs/vfs/kern_descrip.cc. Server workloads
that keep many files and sockets open concurrently (for example a database
under high connection count, where each backend accumulates open relation
files, WAL segments, and client sockets) can exhaust this table and hit
EMFILE, at which point the affected component typically aborts rather than
degrades.

Raise the compile-time default to 0x10000 (65536). This is still a
configurable Kconfig value, so images that want the smaller table can set
it back. The table is an array of pointers, so the extra headroom costs a
few hundred KB of kernel memory at most.

Signed-off-by: Greg Burd <greg@burd.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant