Systems Tuning
Fixing inotify Watch & File Descriptor Exhaustion on Tail Inputs
Resolve "Too many open files" and stalled container log tails by tuning fs.inotify.max_user_watches, max_user_instances, and Rotate_Wait.
max_user_watches 524288 · LimitNOFILE 65535 · Rotate_Wait 5
Why Stale Rotated Files Leak Descriptors
High-churn Kubernetes nodes create and delete hundreds of symlinked container logs per hour. Setting Ignore_Older 48h and Rotate_Wait 5 ensures Fluent Bit stops watching archived logs promptly.
Applying Persistent sysctl & systemd Overrides
Place inotify limits in /etc/sysctl.d/99-logbuffer.conf and add LimitNOFILE=65535 inside /etc/systemd/system/fluent-bit.service.d/limits.conf so changes survive kernel updates.
Measured Parameters & Shipper Configuration Directives
| Kernel / Tail Parameter | Recommended Setting | Operational Reason |
|---|---|---|
| fs.inotify.max_user_watches | 524288 | Default 8,192 exhausts quickly on busy Docker/K8s hosts |
| fs.inotify.max_user_instances | 1024 | Prevents multiple DaemonSets/sidecars failing inotify_init1 |
| systemd LimitNOFILE | 65535 | Allows hundreds of tailed files + DB handles + output sockets |
| Inotify_Watcher / Rotate_Wait | On / 5s (Ignore_Older 48h) | Releases rotated file descriptors cleanly after final drain |