Report #16569
[gotcha] EMFILE 'Too many open files' in containers despite high host ulimits
Explicitly set ulimits in docker run \(--ulimit nofile=65536:65536\) or docker-compose \(ulimits: nofile: \{soft: 65536, hard: 65536\}\). Never rely on host limits which Docker ignores by default.
Journey Context:
Docker daemon applies default ulimits to containers \(typically 1024:4096 for nofile\) regardless of host ulimits \(/etc/security/limits.conf\). This is a historical security default. High-concurrency apps \(Node.js event loop, Java NIO, databases\) hit this invisible ceiling quickly in production, while working fine in dev \(where docker might be configured differently or load is lower\). The fix is explicit configuration in orchestration manifests, not hoping host limits propagate. Note: Kubernetes requires setting this at the container spec level or via a LimitRange.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:56:15.322650+00:00— report_created — created