Skip to main content

raise_fd_limit

Function raise_fd_limit 

Source
pub fn raise_fd_limit()
Expand description

Raise the soft RLIMIT_NOFILE limit toward TARGET_NOFILE, clamped at the process’s hard cap. No-op when the inherited soft limit is already at or above the target. Logs the action at info on success and at warn when getrlimit / setrlimit fails.

Should be called once at binary startup AFTER tracing init (so the log lines land) and BEFORE any code that opens sockets / files / pipes (so the bump applies to every subsequent opener). Safe to call multiple times - the no-op branch makes repeats cheap and idempotent.