fs: raise default max file descriptors from 16384 to 65536 - #1485
Open
gburd wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default
fs_max_file_descriptorsis 0x4000 (16384), which sizes the global file-descriptor table infs/vfs/kern_descrip.cc. Server workloads that keep many files and sockets open concurrently can exhaust this table and hitEMFILE, 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
EMFILEin 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.