Skip to content

Set KillMode=mixed in php-fpm.service #18655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
marcosfrm opened this issue May 25, 2025 · 0 comments
Open

Set KillMode=mixed in php-fpm.service #18655

marcosfrm opened this issue May 25, 2025 · 0 comments

Comments

@marcosfrm
Copy link

Description

php-fpm.service doesn't set KillMode ([Service] section), so it uses control-group, which sends SIGTERM to all processes in the service's cgroup. For php-fpm, where the master process manages child workers, KillMode=mixed is generally better. It sends SIGTERM only to the master process, letting it handle child termination gracefully. If the master doesn't exit within TimeoutStopSec, systemd sends SIGKILL to all processes in the cgroup. If the master exits but leaves child processes behind, systemd sends SIGKILL to clean them up. The mixed option has been supported since systemd 209, which is quite old, so compatibility isn't an issue. More details can be found in the systemd.kill(5) man page.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants