`

php php-fpm - php-fpm status

    博客分类:
  • php
阅读更多
【基本介绍】
这里介绍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 – 上一个请求使用的内存


【参考引用】
http://www.ttlsa.com/php/use-php-fpm-status-page-detail/
https://rtcamp.com/tutorials/php/fpm-status-page/
分享到:
评论

相关推荐

    PHP-FPM-status-Cacti:用于PHP-FPM状态页面的Cacti模板

    PHP-FPM-状态-仙人掌 用于PHP-FPM状态页面的Cacti模板。 基于curl的模板,而不是基于SNMP的模板。 ([屏幕截图]( “ PHP-FPM状态页面屏幕截图的仙人掌模板”)) PHP-FPM状态页面示例。 pool: www process ...

    puppet-phpfpm:管理php-fpm守护程序和池配置

    --phpfpm 概述 该模块管理的php-fpm的守护进程,只有池。 管理php,php扩展名,pear,pecl,nginx,apache等不在本模块的范围之内。 该模块已经在Ubuntu,CentOS / RHEL,Archlinux和Amazon AMI上进行了测试。 ...

    php-7.0.27.tar.gz

    编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/...启动: systemctl start php-fpm systemctl status php-fpm -l

    php-7.1.29.tar.gz

    编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/...启动: systemctl start php-fpm systemctl status php-fpm -l

    php-5.6.29.tar.gz

    编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/...启动: systemctl start php-fpm systemctl status php-fpm -l

    php-7.2.20.tar.gz

    编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/...启动: systemctl start php-fpm systemctl status php-fpm -l

    php-7.3.0.tar.gz

    编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/...systemctl status php-fpm -l

    php-7.3.7.tar.gz

    编译 ./configure --prefix=/usr/local/php --exec-prefix=/usr/local/php --bindir=/usr/local/...启动: systemctl start php-fpm systemctl status php-fpm -l

    php-fpm开启状态统计的方法详解

    $ cat /usr/local/php/etc/php-fpm.conf | grep status pm.status_path = /php-fpm_status nginx配置 默认主机里面加上location location ~ ^/(php-fpm_status|ping) { fastcgi_pass unix:/dev/shm/php-cgi.sock; ...

    PHP-FPM运行状态的实时查看及监控详解

    pm.status_path = /phpfpm_status 配置nginx.conf,添加可访问server server { listen 80; server_name 127.0.0.1; location /phpfpm_status { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; ...

    php-7.3.5-Win32-VC15-x86.zip

    PHP7, 2018年12月发布 添加了 array_key_first() 和 array_key_last() 来获取数组的第一个和...添加了 fpm_get_status() 方法, 来获取FPM状态数组, 添加了几个FPM的配置项, 用来控制日志单行最大字符数, 日志缓冲

    Redhat 使用CentOS的yum源进行升级或软件安装

    # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # #...

    Ubuntu Debian(NGINX/PHP/MYSQL)快速配置工具LNMP云安装

    Nginx状态管理 /etc/init.d/nginx {start|stop|restart|reload|force-reload|status|configtest}PHP5-FPM状态管理 /etc/init.d/php5-fpm {start|stop|status|restart|reload|force-reload}MySQL状态管理/etc/init.d/...

    workerman-statistics:一个分布式统计监控系统包含PHP客户端,服务端

    所需环境需要PHP版本不低于5.3,只需要安装PHP的Cli立即,无需安装PHP-FPM,nginx,apache示例安装1,下载或git clone https://github.com/walkor/workerman-statistics 2,命令行运行composer install启动停止以...

    zabbix-ztc:ztc 涵盖大量zabbix的监控模板,修改了其中的nginx和php用来更好的完成监控工作

    1. ztc 说明zabbix 第三方模板, 涵盖大量监控项官方网址: https://bitbucket.org/rvs/ztc2. php 监控针对 php-fpm 慢日志, 错误日志, 活动队列, 空闲进程等状态进行监控通过抓取 http://localhost/fpm_status 获取...

    AppServerFramework(PHPSwoole).zip

    php asf/bin/asf.php test_http status 查看所有server运行状态: php asf/bin/asf.php list http_server开发 当protocol为http(不设置则默认为http),server运行为http_server,这种模式下默认不...

    Nginx中配置开启Nginx Status来查看服务器运行状态

    nginx和php-fpm一样内建了一个状态页,对于想了解nginx的状态以及监控nginx非常有帮助。为了后续的zabbix监控,我们需要先了解nginx状态页是怎么回事。 1. 启用nginx status配置 在默认主机里面加上location或者你...

    详解linux中 Nginx 常见502错误问题解决办法

    具体就是修改/usr/local/php/etc/php-fpm.conf 文件,将其中的max_children值适当增加。这个数据要依据你的VPS或独立服务器的配置进行设置。一般一个php-cgi进程占20M内存,你可以自己计算下,适量增多。 /usr/...

    CVE-2019-11043-Docker

    带有易受攻击PHP-FPM版本(CVE-2019-11043)和nginx的docker映像。 跑步 docker run --rm -p8080:80 akamajoris/cve-2019-11043您应该能够通过以下网址访问Web应用程序: 。 开发 从...

    3.133.129.101:canadasatellite.ca的新服务器

    的新服务器(Magento 2)。 如何重启服务 service cron restart service mysql restart service nginx restart...service php7.2-fpm status service prod_dynamics_integration status service rabbitmq-server status

Global site tag (gtag.js) - Google Analytics