Skip to content

pool stats from fcgi - total processes != pm.max_children for  #16964

@qeepcologne

Description

@qeepcologne

Description

using the following pool:

cat www.conf|grep -v ";"|grep "\S"
[www]
user = www-data
group = www-data
listen = /run/php/php8.4-fpm.sock
listen.owner = www-data
listen.group = www-data
pm = static
pm.max_children = 50
pm.max_requests=1000
pm.status_path=/status8.4

and status:

php_version=$(php -v|head -n1|cut -d' ' -f2|cut -d'.' -f1-2)
export SCRIPT_NAME=/status$php_version; export SCRIPT_FILENAME=/status$php_version; export REQUEST_METHOD=GET; cgi-fcgi -bind -connect /run/php/php$php_version-fpm.sock

returns most of the time:

Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
Content-type: text/plain;charset=UTF-8

pool:                 www
process manager:      static
start time:           27/Nov/2024:16:14:18 +0100
start since:          2885
accepted conn:        1
listen queue:         0
max listen queue:     0
listen queue len:     0
**idle processes:       0**
active processes:     1
**total processes:      1**
max active processes: 4
max children reached: 0
slow requests:        0
memory peak:          73400320

expected output:

Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, max-age=0
Content-type: text/plain;charset=UTF-8

pool:                 www
process manager:      static
start time:           27/Nov/2024:16:14:18 +0100
start since:          2885
accepted conn:        1
listen queue:         0
max listen queue:     0
listen queue len:     0
**idle processes:       49**
active processes:     1
**total processes:      50**
max active processes: 4
max children reached: 0
slow requests:        0
memory peak:          73400320

this always worked on php 5.6-8.3, but with current 8.4.1 it sometimes returned the output above.
Wrong output is returned a lot (30-100%), so not an edge case during max requests process recreation.
I think it is only shown wrong, when i count processes via ps e.g. they are always present.

I used this in monitoring script to calculate the rate of active/total processes.

PHP Version

PHP 8.4.1-3

Operating System

Ubuntu 24.04.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions