hipages / php-fpm_exporter

A prometheus exporter for PHP-FPM.
Apache License 2.0
592 stars 119 forks source link

max_children_reached always 1 #113

Closed phutoan31299 closed 3 years ago

phutoan31299 commented 3 years ago

Hello, firstly, i want to say thank you for a amazing exporter and then i want to show u my problem and please help me. Why max_children_reach always is 1 since turn on exporter, this number don't increase although the process is reached max_children (pm.max_children = 4) many times (# active processes = 4 and request per process always running with 4 process)? Can u explain for me cause maybe i understand wrong ways :( Tks a lot!

matejzero commented 3 years ago

This is by design. max_children_reach is collected from php-fpm status, where it only reports if max was reached since php-fpm started and not how many times is was reached. It's a boolean value.

estahn commented 3 years ago

@matejzero, As far as I know, php-fpm should report the number of times a pool reached max children.

I have documented here, but are you saying this is not the case?

# HELP phpfpm_max_children_reached The number of times, the process limit has been reached, when pm tries to start more children (works only for pm 'dynamic' and 'ondemand').
# TYPE phpfpm_max_children_reached counter

See: https://github.com/php/php-src/blob/44c7128fb726696a7c23ff694d1077cf0cf435d4/sapi/fpm/fpm/fpm_scoreboard.c#L144

estahn commented 3 years ago

@phutoan31299 Can you share your PHP-FPM pool config?

phutoan31299 commented 3 years ago

@phutoan31299 Can you share your PHP-FPM pool config? @estahn Thanks u. My pool conf is here


emergency_restart_interval = 1m
process_control_timeout = 10s
[www]
user = ttvtnet
group = ttvtnet

pm = dynamic pm.max_children = 4 pm.start_servers = 3 pm.min_spare_servers = 2 pm.max_spare_servers = 4 pm.max_requests = 200

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.