In this article
Measure the worker descriptor set and its lifecycle; shard mappings, open handles and connection sockets are different populations.
A sharded model opens its weights successfully but later cannot accept another connection. File descriptors belong to more than shard files: sockets, pipes and runtime event objects share the process’s descriptor namespace. Diagnose the failed operation and actual descriptor population before estimating a limit from the number of model files.
Attach the failure to a process
Preserve the failing operation, errno, process identity and time. EMFILE identifies the per-process descriptor boundary; a system-wide file-table failure is a different diagnosis. A parent and each child can have different open sets even when they share inherited limits. Avoid reporting one aggregate count for the entire service as if it were the worker’s effective limit.
Inventory descriptor types
The authorized process fd directory exposes entries for open descriptors. Group them by safe type and identity: model files, sockets, pipes and anonymous kernel objects. Descriptor numbers can be sparse, so both population and the highest allocated number can matter when comparing with RLIMIT_NOFILE. Capture changes across loading and steady service rather than assuming startup is the peak.
Keep mappings separate
A successful mmap can remain valid after the original descriptor is closed. A large number of weight mappings therefore does not establish the same number of retained file descriptors. Conversely, a loader may intentionally retain handles. Compare the actual fd and mapping observations instead of assuming a particular library strategy from the file format or sharding scheme.
Look for lifecycle growth
Repeat a bounded load-and-unload or connection cycle in an isolated equivalent. If counts keep increasing after cleanup, identify the descriptor class responsible before enlarging the allowance. A justified peak requires room for accepted clients and internal control channels. An unlimited setting can postpone failure while preserving a leak and increasing the number of clients affected later.
Verify the launch configuration
Inspect the running worker’s effective soft and hard limit and the configuration that launches it. A changed interactive shell does not retroactively change a service. Acceptance means the same workload completes with stable descriptor behavior and an understood allowance. It does not prove that every future shard layout fits, that mappings are resident or that connection handling meets the latency target.
Primary references
Related reading: OS page cache and cold model loading: what to record; Graceful inference-server termination with active streams.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.