Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117005 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 84715 invoked from network); 7 Feb 2022 19:51:48 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 7 Feb 2022 19:51:48 -0000 To: internals@lists.php.net Date: Mon, 7 Feb 2022 22:07:36 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 82.64.142.110 Subject: PHP-FPM master exit after idle From: bugs-php@antipoul.fr (Adrien CLERC) Message-ID: 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