What are file descriptor limits, and where are they set?
BeginnerProductionLogs, Limits & High-Traffic Tuning
Answer
Each process can open only so many files and sockets. There is a per-process soft and hard limit (RLIMIT_NOFILE) and a system-wide maximum.
ulimit -n; ulimit -Hn # current shell soft/hard
cat /proc/<pid>/limits | grep 'open files'
cat /proc/sys/fs/file-max # system-wide max
cat /proc/sys/fs/file-nr # allocated, unused, max
Hitting the limit gives EMFILE: Too many open files.
More on Logs, Limits & High-Traffic Tuning
How does log management work on a modern Linux server?BeginnerWhy centralize logs instead of reading them on each server?BeginnerWrite a logrotate config for an application log.BeginnerWhat is the difference between `copytruncate` and `create` + postrotate signal?IntermediateLogs rotated but disk usage did not drop. Why?IntermediateHow often does logrotate run, and why does `maxsize` sometimes not trigger in time?Intermediate