Skip to content

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

Open
@marcosfrm

Description

@marcosfrm

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!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions