hipages / php-fpm_exporter

A prometheus exporter for PHP-FPM.
Apache License 2.0
594 stars 120 forks source link

phpfpm_listen_queue is always zero #138

Open abrarcv170 opened 3 years ago

abrarcv170 commented 3 years ago

php-fpm_listen_queue is always zero,iam faced a situation in which some php-fpm processes queued,but the exporter displayed zero php-fpm process request queued.

bagsa commented 3 years ago

php-fpm_listen_queue is always zero,iam faced a situation in which some php-fpm processes queued,but the exporter displayed

zero php-fpm process request queued.

estahn commented 3 years ago

@abrarcv170 @bagsa Are you able to describe your setup, e.g. Apache, Nginx, PHP mod or PHP-FPM etc, also what version.

I found this, which might be related: https://bugs.php.net/bug.php?id=80739

It's working fine for us: image

blkperl commented 3 years ago

@estahn We're hitting the same issue and it definitely looks related to the php bug you linked. What version of PHP do you have it working on and which process manager are you using? I've tested on php73 and php74. I tried changing listen.backlog to other values but listen queue len still shows up as 0.

QUERY_STRING="json" SCRIPT_NAME=/status   SCRIPT_FILENAME=/status   REQUEST_METHOD=GET cgi-fcgi -bind -connect /var/www/php-fp
m.sock | tail -n1 | jq
{
  "pool": "www",
  "process manager": "static",
  "start time": 1620948750,
  "start since": 429,
  "accepted conn": 232,
  "listen queue": 0,
  "max listen queue": 0,
  "listen queue len": 0,
  "idle processes": 0,
  "active processes": 4,
  "total processes": 4,
  "max active processes": 4,
  "max children reached": 0,
  "slow requests": 0
}
estahn commented 3 years ago

@blkperl

PHP (7.3.27) 64-bit PHP-FPM
abrarcv170 commented 3 years ago

@estahn nginx,php-fpm (php version 7.4)

glennpratt commented 3 years ago

@estahn is your php-fpm listening on TCP/IP or Unix Domain Socket?

estahn commented 3 years ago

@estahn is your php-fpm listening on TCP/IP or Unix Domain Socket?

You can configure either, see README:

FastCGI address, e.g. unix:///tmp/php.sock;/status or tcp://127.0.0.1:9000/status

glennpratt commented 3 years ago

@estahn I understand. I'm asking in relation to this issue and the php-fpm bug linked. It may be that the queue stats are only available when using TCP.

stale[bot] commented 2 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.