Interview Prep/Linux/Logs, Limits & High-Traffic Tuning

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.

All Linux questions Roadmap: Linux

More on Logs, Limits & High-Traffic Tuning