Req #75440 [Com]: Fpm reload should be graceful, not killing running processes
| From: | pietro at dkremoto dot it | Date: | Tue, 10 Apr 2018 09:28:05 +0000 |
| Subject: | Req #75440 [Com]: Fpm reload should be graceful, not killing running processes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214676@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75440&edit=1
ID: 75440
Comment by: pietro at dkremoto dot it
Reported by: sjon at hortensius dot net
Summary: Fpm reload should be graceful, not killing running
processes
Status: Open
Type: Feature/Change Request
Package: FPM related
Operating System: linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
I've done some other test for this specific bug and I've discovered more,
If i do something like this
-----------------------------
<?php
$start = time();
sleep(20);
echo "Execution time: ".(time()-$start)."s";
?>
and then i reload fpm, the scriptâs execution will stop immediately reporting the execution
time elapsed form the launch of the script and the fpm reload
Else if i do something like that:
-----------------------------
<?php
$start = time();
for($i=0; $i<20; $i++) {
sleep(1);
}
echo "Execution time: ".(time()-$start)."s";
?>
and reload FPM, he wonât be serve any other request for the amount of seconds of the cicle, (20
sec) but will terminate the execution of the script correctly.
The most terrifying thing is that if I have this kind of cicle with heavy computation and I launch a
reload, all the websites under the pool will be unreachable until the script with the heavy cicle
will finish.
Previous Comments:
------------------------------------------------------------------------
[2017-10-25 13:43:39] sjon at hortensius dot net
Description:
------------
When fpm receives a USR2 (reload) signal it should reload it's configuration.
However, it currently also kills existing connections / and/or refuses to accept new connections for
a short period. This results in errors suchs as 'connect() failed (111: Connection refused)
while connecting to upstream' in my nginx logs.
Executing a reload should be more graceful, not throwing any errors or refusing connections and
behave like
nginx -s reload
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75440&edit=1