How do you protect a host from fork bombs and runaway process counts?
IntermediateProductionLogs, Limits & High-Traffic Tuning
Answer
Limit processes per user (nproc in limits.conf for login users), per service (TasksMax= in systemd units), and for containers (pids.max via --pids-limit or Kubernetes pod PID limits). systemd's default TasksMax on user slices already prevents a single user's fork bomb from taking down the host.
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