php php-fpm - php-fpm status

【基本介绍】
这里介绍php-fpm的status.可以查看php-fpm的进程相关的信息。

【基本配置】
php-fpm的配置文件,使用pm.status_pat=

; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. By default, the status page shows the following
; information:
; accepted conn - the number of request accepted by the pool;
; pool - the name of the pool;
; process manager - static or dynamic;
; idle processes - the number of idle processes;
; active processes - the number of active processes;
; total processes - the number of idle + active processes.
; The values of 'idle processes', 'active processes' and 'total processes' are
; updated each second. The value of 'accepted conn' is updated in real time.
; Example output:
; accepted conn: 12073
; pool: www
; process manager: static
; idle processes: 35
; active processes: 65
; total processes: 100
; By default the status page output is formatted as text/plain. Passing either
; 'html' or 'json' as a query string will return the corresponding output
; syntax. Example:
; http://www.foo.bar/status
; http://www.foo.bar/status?json
; http://www.foo.bar/status?html
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
pm.status_path = /fpm-status


在web服务中添加配置,
例如:nginx中添加location

location ~ ^/(status|ping)$ {
access_log off;
allow 127.0.0.1;
allow 1.2.3.4#your-ip;
deny all;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;


【结果分析】
http://domain/fpm-status

pool: www #fpm池子名称,大多数为www
process manager: dynamic #进程管理方式,值:static, dynamic or ondemand. dynamic
start time: 17/Nov/2014:22:59:48 +0800 #启动日期,如果reload了php-fpm,时间会更新
start since: 59509 # 运行时长
accepted conn: 115850 #当前池子接受的请求数
listen queue: 0 #请求等待队列,如果这个值不为0,那么要增加FPM的进程数量
max listen queue: 1 #请求等待队列最高的数量
listen queue len: 0 #socket等待队列长度
idle processes: 14 #空闲进程数量
active processes: 2 #活跃进程数量
total processes: 16 #总进程数量
max active processes: 9 #最大的活跃进程数量(FPM启动开始算)
max children reached: 0 #大道进程最大数量限制的次数,如果这个数量不为0,
#那说明你的最大进程数量太小了,请改大一点。
slow requests: 3 #启用了php-fpm slow-log,缓慢请求的数量


【其他参数】
php-fpm状态页比较个性化的一个地方是它可以带参数,可以带参数json、xml、html并且前面三个参数可以分别和full做一个组合。(见参考引用链接)

full详解
pid – 进程PID,可以单独kill这个进程. You can use this PID to kill a long running process.
state – 当前进程的状态 (Idle, Running, …)
start time – 进程启动的日期
start since – 当前进程运行时长
requests – 当前进程处理了多少个请求
request duration – 请求时长(微妙)
request method – 请求方法 (GET, POST, …)
request URI – 请求URI
content length – 请求内容长度 (仅用于 POST)
user – 用户 (PHP_AUTH_USER) (or ‘-’ 如果没设置)
script – PHP脚本 (or ‘-’ if not set)
last request cpu – 最后一个请求CPU使用率。
last request memorythe – 上一个请求使用的内存


【参考引用】
[url]http://www.ttlsa.com/php/use-php-fpm-status-page-detail/[/url]
[url]https://rtcamp.com/tutorials/php/fpm-status-page/[/url]
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值