What is `kernel.pid_max` and `TasksMax`, and why do they matter?
AdvancedProductionLogs, Limits & High-Traffic Tuning
Answer
kernel.pid_max caps PIDs (threads count too); default is 32768 on small systems and up to 4194304 on large 64-bit ones. systemd also limits tasks per unit (TasksMax=, default 15% of the kernel limit via DefaultTasksMax), and per user slice. Thread-heavy apps (JVMs with thousands of threads) fail with fork: Resource temporarily unavailable or unable to create native thread long before CPU or memory is exhausted. Check systemctl show api -p TasksCurrent -p TasksMax.
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