php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76323 FPM /status reports wrong number of listen queue len
Submitted: 2018-05-10 03:50 UTC Modified: 2022-11-13 15:44 UTC
Votes:10
Avg. Score:3.5 ± 0.9
Reproduced:9 of 9 (100.0%)
Same Version:1 (11.1%)
Same OS:1 (11.1%)
From: china_nzf at 163 dot com Assigned: bukka (profile)
Status: Assigned Package: FPM related
PHP Version: 7.0Git-2018-05-10 (Git) OS: CentOS release 6.9 (Final)
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: china_nzf at 163 dot com
New email:
PHP Version: OS:

 

 [2018-05-10 03:50 UTC] china_nzf at 163 dot com
Description:
------------
When I first request php-fpm status page with command:
$ curl www.php-fpm.com/status

pool:                 www
process manager:      static
start time:           10/May/2018:11:36:11 +0800
start since:          2
accepted conn:        1
listen queue:         0
max listen queue:     0
listen queue len:     128
idle processes:       9
active processes:     1
total processes:      10
max active processes: 1
max children reached: 0
slow requests:        0

Then I set the pool to static with listen.backlog to 256, reloading the fpm. I would expect the metric "listen queue len" to be 256. But still will have "listen queue len" report 128. 

$ sudo kill -USR2 $(cat /var/run/php-fpm.pid)
$ curl www.php-fpm.com/status

pool:                 www
process manager:      static
start time:           10/May/2018:11:40:11 +0800
start since:          1
accepted conn:        1
listen queue:         0
max listen queue:     0
listen queue len:     128
idle processes:       9
active processes:     1
total processes:      10
max active processes: 1
max children reached: 0
slow requests:        0

I cat the somaxconn is 512
net.core.somaxconn:
$ cat /proc/sys/net/core/somaxconn
512

Pool configuration:
$ grep -v ";" ~/php7/etc/php-fpm.d/www.conf | grep -Ev "^$"
[www]
user = fpm
group = fpm
listen = 127.0.0.1:9000
listen.backlog = 256
pm = static
pm.max_children = 10
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 500
pm.status_path = /status
slowlog = logs/$pool.log.slow
request_slowlog_timeout = 1
env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

Finally, I want to know the details.

Expected result:
----------------
Metric "listen queue len" from /status should be 256.

Actual result:
--------------
Metric "listen queue len" from /status should is 128.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2022-10-30 20:28 UTC] bukka@php.net
-Assigned To: +Assigned To: bukka
 [2022-10-30 20:28 UTC] bukka@php.net
So after a look it uses tcpi_sacked from tcp_info struct on Linux so it doesn't exactly have to match /proc/sys/net/core/somaxconn from what I understand. I will need to investigate if there's a better way to get it though.
 [2022-11-13 15:44 UTC] bukka@php.net
So I investigated even more and finally put together an issue with work needed to address this: https://github.com/php/php-src/issues/9943 .
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 10 11:01:29 2024 UTC