php / php/php-src

FPM Status: active processes greater than pm.max_children

Abierto
#14,212 9 comentarios 1 reacción 1 asignado Ver en GitHub

@bukka ya está trabajando en esto.

Desde el 13/5/2024.

Bug SAPI: fpm
Lenguaje dominante
C
Estrellas
40.4k
Forks
8.2k
Merge medio
2 d 13 h
PR fusionados (30 d)
96

Descripción

Description

Given the following FPM Pool configuration the Pool is configured using 1500 static workers and a listen.backlog of 100:

$ cat /etc/php/8.3/fpm/pool.d/backoffice.conf 
[backoffice]
listen = /run/php8.3-fpm_backoffice.sock
listen.backlog = 100

pm = static
pm.max_children = 1500
pm.status_path = /php8.3-fpm-status-backoffice.php

; The number of requests each child process should execute before respawning. This can be useful to work around memory leaks
pm.max_requests = 2000

The listen.backlog works like expected on the socket.

$ ss -lxn src ==  /run/php8.3-fpm_backoffice.sock
Netid                      State                       Recv-Q                      Send-Q                                                              Local Address:Port                                              Peer Address:Port                      Process
u_str                      LISTEN                      0                           100                                               /run/php8.3-fpm_backoffice.sock 47129                                                        * 0

Without high traffic total processes reports 1500 as expected.

$ curl -s 127.0.0.1:80/php8.3-fpm-status-backoffice.php
pool:                 backoffice
process manager:      static
start time:           13/May/2024:04:02:02 +0200
start since:          22533
accepted conn:        3057525
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       1460
active processes:     40
total processes:      1500
max active processes: 549
max children reached: 0
slow requests:        0

When generating high concurrent requests using a tool like siege or k6 I can observe the following output from the status page:

$ curl 127.0.0.1:80/php8.3-fpm-status-backoffice.php
pool:                 backoffice
process manager:      static
start time:           08/May/2024:04:02:01 +0200
start since:          19565
accepted conn:        10120636
listen queue:         0
max listen queue:     0
listen queue len:     0
idle processes:       1
active processes:     3347
total processes:      3348
max active processes: 3503
max children reached: 0
slow requests:        0

active processes/total processes/max active processes are way over the defined pm.max_children = 1500.

How can active processes be greater than pm.max_children?

Also max children reachedreports 0.

Relates to: https://github.com/php/php-src/issues/9943#issuecomment-1607206535

PHP Version

PHP 8.3.6

Operating System

Debian 11

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.