-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drastically improve zombie process cleanup efficiency
This commit overhauls the zombie process cleanup script, addressing a critical performance issue: - Previously, the script would scan all processes and zombies, gathering parent PIDs for EACH zombie. This approach was extremely inefficient, taking up to 20 minutes when the server had 465,276 zombie processes. - Now, the script stops after finding the first zombie process and focuses on terminating its parent. This approach is based on the understanding that multiple zombies are typically linked to a single parent process. Terminating the parent process will make all of its zombie children disappear, drastically improving efficiency. Other improvements include: - Add safety checks to avoid terminating containerd-shim processes - Remove the zombie threshold check, allowing immediate action on all zombies. This prevents the misconception that a small number of zombie processes is acceptable and encourages users to properly address the root cause by integrating process reapers like tini. - Increase crontab execution frequency from every 15 minutes to every 5 minutes These changes result in a much more responsive and efficient handling of zombie processes, reducing cleanup time from 20 minutes to just seconds, even with hundreds of thousands of zombies.
- Loading branch information
1 parent
28f9433
commit 9553925
Showing
1 changed file
with
78 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters