# PHP-FPM master exit after idle

- Thread: https://externals.io/message/117005
- Original archive: https://news-web.php.net/php.internals/117005
- Started by Adrien CLERC on 2022-02-07T21:07:36+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #117005 — Adrien CLERC — 2022-02-07T21:07:36+00:00

URL: https://externals.io/message/117005#117005

Hi,

I'm currently investigating on using socket activation for PHP-FPM (as 
described in https://wiki.php.net/rfc/socketactivation). Everything is 
running fine, and each application can have its dedicated FPM master 
process, protected by all the settings set in the systemd unit file.

There is however one catch on the current situation: once the FPM master 
is started, it doesn't stop. Since systemd will maintain a listening 
socket, the master process could stop itself after a given idle time, 
defined in a new setting. This will have the benefits of freeing server 
resources. I have to admit that in my case, those resources are 
important, since I'm self-hosting quite a number of applications on a 
low power consumption machine.

I dived a little into the FPM code, and since it already has a logic for 
process idle management, it should be absolutely doable to add it for 
the master.

However… before throwing my free time into this, I'd like to gather some 
feedback on this. PHP is a big beast, and I know that my point of view 
is not The Only One That Should Count.

Have a nice day!

Adrien
