Report #13826
[gotcha] Container crashes with 'too many open files' \(EMFILE\) despite host having high ulimit
Set ulimits in docker run \(--ulimit nofile=65536:65536\) or Kubernetes securityContext \(requires privileged or specific kubelet config in older versions\). Verify with 'ulimit -n' inside container, not on host.
Journey Context:
Container runtimes inherit ulimits from the daemon, often defaulting to 1024:4096 or 1024:unlimited depending on Docker version and host systemd. High-concurrency services \(databases, proxies\) hit this ceiling fast. Developers check 'ulimit -n' on the host \(shows 65535\) and are confused. Kubernetes didn't support setting ulimits in securityContext until recent versions \(now supported via limits.hugepages? No, ulimits are set via docker/containerd runtime options or securityContext, but K8s support is limited\). The fix is explicit runtime configuration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T19:50:14.807042+00:00— report_created — created