Bug #63395 [Opn->Csd]: Spawned processes do not perform
| From: | bukka@php.net | Date: | Thu, 09 Dec 2021 22:16:53 +0000 |
| Subject: | Bug #63395 [Opn->Csd]: Spawned processes do not perform | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-238308@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63395&edit=1
ID: 63395
Updated by: bukka@php.net
Reported by: Alex at phpguide dot co dot il
Summary: Spawned processes do not perform
-Status: Open
+Status: Closed
Type: Bug
Package: FPM related
Operating System: Ubuntu 12.04 x64
PHP Version: 5.4.8
-Assigned To:
+Assigned To: bukka
Block user comment: N
Private report: N
New Comment:
There's no a configuration option pm.max_spawn_rate (introduced in PHP 8.1) that allows
customizing the rate and preventing this problem. Please see more details in https://github.com/php/php-src/pull/6753
Previous Comments:
------------------------------------------------------------------------
[2017-11-30 17:19:59] federico dot omoto at gmail dot com
This is a really old bug that is affecting PHP versions <= 7.2.0.
Can we expect it to be fixed soon?
------------------------------------------------------------------------
[2014-04-15 07:39:42] roger dot qiu at polycademy dot com
Yep this is definitely a bug. I experienced the same thing.
Basically if you have NGINX with upstream keepalive, and if this number is > than the
pm.max_children in FPM, then what happens is that, if there is a X amount of concurrent requests
(from for example Apache Bench), in which X is greater than the pm.max_children, this will result in
Apache Bench freezing and sometimes never completing certain requests.
If the keepalive number is lower than the max_children (not equal), this problem then doesn't
exist.
------------------------------------------------------------------------
[2013-02-13 09:50:26] php-bugs at puzzled dot xs4all dot nl
This bug seems similar to https://bugs.php.net/bug.php?id=60961
------------------------------------------------------------------------
[2012-10-30 10:20:30] Alex at phpguide dot co dot il
Description:
------------
I'm running nginx 1.2.4 with php5-fpm (5.4.8) issuing
ab -n 20000 -c 1000 http://localhost/index.php
When
pm = dynamic
pm.max_children = 3000
pm.start_servers = 100 <- this is important
pm.max_spare_servers = 1000
I'm having a lot of errors in nginx talking to php
[error] 26125#0: *49177 upstream prematurely closed connection while reading
response header from upstream, ... "fastcgi://127.0.0.1:9000"
[error] 26125#0: *56030 recv() failed (104: Connection reset by peer) while
reading response header from upstream, ... upstream: "fastcgi://127.0.0.1:9000"
The fpm log shows a lot of
WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or
pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and X total
children
When spawning new children reaches a concrete amount nginx stops issuing such
errors. This leads me to believe freshly spawned processes do not execute and
respond correctly.
Now, when I start with 3000 children straight ahead, all connections work
properly. No errors in nginx or fpm.
pm = dynamic
pm.max_children = 3000
pm.start_servers = 3000 <- Straight ahead
pm.max_spare_servers = 3000
Test script:
---------------
The php code on the server is relatively simple.
apc_inc('count111'); sleep(1); echo 'x';
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63395&edit=1