Commit c43d1c6
committed
feat(runtime): document FastCGI keepalive starving php-fpm
A php-fpm child stays bound to its FastCGI connection for as long as that
connection lives, so an nginx keepalive pool to php-fpm parks workers
rather than idle sockets. Sized at or above `pm.max_children` it can pin
every child while arriving requests wait for one to come free.
What makes it expensive to diagnose is that every obvious instrument says
"fine": the container sits at 0 % CPU with flat memory, the php-fpm
slowlog stays empty at a 5 s threshold because the scripts were never
slow, and the stalled requests answer HTTP 200 — after a minute. The
reference states the full signature, since any one of those readings
alone points somewhere else.
It also hides from local testing: only a client that issues everything at
once builds the queue, so it appears over HTTP/2 through a reverse proxy
and not when the application container is addressed directly.
Measured on a TYPO3 backend behind Caddy with pm.max_children = 10:
61005 ms slowest request with `keepalive 16`, 19614 ms with 8, 107 ms
with the pool removed.
Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>1 parent c8867db commit c43d1c6
2 files changed
Lines changed: 60 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
0 commit comments