zabbix监控php-fpm性能状态
1. 启用php-fpm状态功能
# cat /usr/local/php/etc/php-fpm.conf | grep status_path
pm.status_path = /status
2. nginx配置
location ~ ^/(status|ping)$
{
include fastcgi_params;
fastcgi_pass 127.0.0.1:;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
}
3. 重启nginx/php-fpm
# service nginx restart
# service php-fpm restart
4. 打开status页面
# curl http://127.0.0.1/status
pool: www
process manager: dynamic
start time: /Feb/::: +
start since:
accepted conn:
listen queue:
max listen queue:
listen queue len:
idle processes:
active processes:
total processes:
max active processes:
max children reached:
slow requests:
5. php-fpm status详解
pool – fpm池子名称,大多数为www
process manager – 进程管理方式,值:static, dynamic or ondemand. dynamic
start time – 启动日期,如果reload了php-fpm,时间会更新
start since – 运行时长
accepted conn – 当前池子接受的请求数
listen queue – 请求等待队列,如果这个值不为0,那么要增加FPM的进程数量
max listen queue – 请求等待队列最高的数量
listen queue len – socket等待队列长度
idle processes – 空闲进程数量
active processes – 活跃进程数量
total processes – 总进程数量
max active processes – 最大的活跃进程数量(FPM启动开始算)
max children reached - 大道进程最大数量限制的次数,如果这个数量不为0,那说明你的最大进程数量太小了,请改大一点。
slow requests – 启用了php-fpm slow-log,缓慢请求的数量
6. php-fpm其他参数
php-fpm状态页比较个性化的一个地方是它可以带参数,可以带参数json、xml、html并且前面三个参数可以分别和full做一个组合。
6.1 json
# curl http://127.0.0.1/status?json
{"pool":"www","process manager":"dynamic","start time":,"start since":,"accepted conn":,"listen queue":,"max listen queue":,"listen queue len":,"idle processes":,"active processes":,"total processes":,"max active processes":,"max children reached":,"slow requests":}
6.2 xml
# curl http://127.0.0.1/status?xml
<?xml version="1.0" ?>
<status>
<pool>www</pool>
<process-manager>dynamic</process-manager>
<start-time></start-time>
<start-since></start-since>
<accepted-conn></accepted-conn>
<listen-queue></listen-queue>
<max-listen-queue></max-listen-queue>
<listen-queue-len></listen-queue-len>
<idle-processes></idle-processes>
<active-processes></active-processes>
<total-processes></total-processes>
<max-active-processes></max-active-processes>
<max-children-reached></max-children-reached>
<slow-requests></slow-requests>
6.3 html
# curl http://127.0.0.1/status?html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>PHP-FPM Status Page</title></head>
<body>
<table>
<tr><th>pool</th><td>www</td></tr>
<tr><th>process manager</th><td>dynamic</td></tr>
<tr><th>start time</th><td>/Feb/::: +</td></tr>
<tr><th>start since</th><td></td></tr>
<tr><th>accepted conn</th><td></td></tr>
<tr><th>listen queue</th><td></td></tr>
<tr><th>max listen queue</th><td></td></tr>
<tr><th>listen queue len</th><td></td></tr>
<tr><th>idle processes</th><td></td></tr>
<tr><th>active processes</th><td></td></tr>
<tr><th>total processes</th><td></td></tr>
<tr><th>max active processes</th><td></td></tr>
<tr><th>max children reached</th><td></td></tr>
<tr><th>slow requests</th><td></td></tr>
</table>
</body></html>
6.4 full
# curl http://127.0.0.1/status?full
pool: www
process manager: dynamic
start time: /Feb/::: +
start since:
accepted conn:
listen queue:
max listen queue:
listen queue len:
idle processes:
active processes:
total processes:
max active processes:
max children reached:
slow requests: ************************
pid:
state: Idle
start time: /Feb/::: +
start since:
requests:
request duration:
request method: GET
request URI: /sesamestreet/elmo/index.php
content length:
user: -
script: /www//sesamestreet/elmo/index.php
last request cpu: 38.14
last request memory: ************************
pid:
state: Idle
start time: /Feb/::: +
start since:
requests:
request duration:
request method: GET
request URI: /index.php
content length:
user: -
script: /www//index.php
last request cpu: 0.00
last request memory: ************************
pid:
state: Idle
start time: /Feb/::: +
start since:
requests:
request duration:
request method: GET
request URI: /status?xml
content length:
user: -
script: /status
last request cpu: 0.00
last request memory: ************************
pid:
state: Idle
start time: /Feb/::: +
start since:
requests:
request duration:
request method: GET
request URI: /index.php
content length:
user: -
script: /www//index.php
last request cpu: 0.00
last request memory: ************************
pid:
state: Idle
start time: /Feb/::: +
start since:
requests:
request duration:
request method: GET
request URI: /sesamestreet/elmo/index.php
content length:
user: -
script: /www//sesamestreet/elmo/index.php
last request cpu: 64.27
last request memory: ************************
pid:
state: Running
start time: /Feb/::: +
start since:
requests:
request duration:
request method: GET
request URI: /status?full
content length:
user: -
script: /status
last request cpu: 0.00
last request memory:
6.5 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 - 上一个请求使用的内存
zabbix客户端配置
增加自定义key
# cat zabbix_agentd.conf | grep 'php-fpm'
#php-fpm
UserParameter=php-fpm.status[*],/usr/bin/curl -s "http://127.0.0.1/status?xml" | grep "<$1>" | awk -F'>|<' '{ print $$3}'
重启zabbix客户端
/etc/init.d/zabbix_agentd restart
zabbix管理后台配置
导入php-fpm模板
进入后台->configuration->templates->import(右侧)->选择php模板->最后点击import。至此php-fpm模板已经导入到zabbix中
zabbix监控php-fpm性能状态的更多相关文章
- zabbix 监控web网站性能
一直在纠结用什么实例来给大家演示呢?想来想去还是官方的好,那我们怎么用zabbix监控web性能和可用性呢?我们这边分为几个步骤:打开网站.登陆.登陆验证.退出,一共4个小step,看实例. 检测流程 ...
- Zabbix监控web,MySQL,TCP状态,Nginx
接上篇Zabbix使用SMTP发送邮件报警并且制定报警内容 Zabbix怎么设置声音告警 web监控 在zabbix server选择web 创建一个监控web的场景 添加后这里有数字1 查看 假如在 ...
- zabbix监控WEB网站性能
一直在纠结用什么实例来给大家演示呢?想来想去还是官方的好,那我们怎么用zabbix监控web性能和可用性呢?我们这边分为几个步骤:打开网站.登陆.登陆验证.退出,一共4个小step,看实例. 检测流程 ...
- zabbix监控php-fpm的性能
zabbix监控php-fpm主要是通过nginx配置php-fpm的状态输出页面,在正则取值 要nginx能输出php-fpm的状态必须要先修改php-fpm的配置,这个配置没有开启nginx 就没 ...
- zabbix监控nginx的性能
1.nginx配置 需要使用zabbix监控nginx,首先nginx需要配置ngx_status,在nginx的配置文件中加入红框中的配置,然后重启nginx如下图所示: location /ngx ...
- (41)zabbix监控api接口性能及可用性 天气预报api为例
现在各种应用都走api,例如淘宝,天气预报等手机.pad客户端都是走api的,那么平时也得对这些api做监控了.怎么做呢?zabbix的web监控是不二选择了.今天就以天气预报api作为一个例子. 天 ...
- zabbix监控rabbitmq队列消费状态
使用rabbitmqctl 管理 mq -n 指定节点 [root@logging-master zabbix]# rabbitmqctl -n rabbit@localhost list_queue ...
- zabbix 监控 WEB 应用性能
1.介绍使用 zabbix_sender 发送采集的 WEB 状态值,使用 pycurl 来采集 WEB 状态zabbix_sender发送数据,需保证主机名与zabbix server记录的主机名一 ...
- zabbix监控nginx+php-fpm,mysql+主从复制+高可用,tomcat,redis web状态
zabbix监控对象区分 使用SNMP监控交换 使用IPMI监控服务器硬件 使用Agent监控服务器 使用JMX监控JAVA SNMP监控流程 交换机上开启snmp 在zabbix上添加监控(设置SN ...
- 跟着ttlsa一起学zabbix监控呗
本章转载至:http://www.ttlsa.com/zabbix/follow-ttlsa-to-study-zabbix/ 虽然接触zabbix时间很长,但是中间相当一段时间没去配置,这次算是重新 ...
随机推荐
- Web 前端代码规范
Web 前端代码规范 最后更新时间:2017-06-25 原始文章链接:https://github.com/bxm0927/web-code-standards 此项目用于记录规范的.高可维护性的前 ...
- vue setTimeout用法 jquery滚动到某一个div的底部
//vue 中setTimeOut用法 var $this = this; setTimeout(function(){ $this.goEnd() }, 10); goEnd:function(){ ...
- Jenkins构建本地项目到服务器上自动部署的方法
博主原创,转载请注明. 最近在用Jenkins做项目的自动部署,由于项目需求,现在要在本地构建后再放到Tomcat里.以下是本地构建步骤: 名称填写好,下面的选项是可选的. 源码管理这里选择none. ...
- http请求的完整过程
HTTP通信机制是在一次完整的HTTP通信过程中,Web浏览器与Web服务器之间将完成下列7个步骤: 1. 建立TCP连接 在HTTP工作开始之前,Web浏览器首先要通过网络与Web服务器建立连接,该 ...
- [leetcode-592-Fraction Addition and Subtraction]
Given a string representing an expression of fraction addition and subtraction, you need to return t ...
- USACO Ordered Fractions
首先看一下题目 Consider the set of all reduced fractions between 0 and 1 inclusive with denominators less t ...
- java桥连接sql server之登录验证及对数据库增删改查
一:步骤 1.sql server建立数据库和相关表 2.建立数据源 (1).打开控制面板找到管理,打开ODBC选项或直接搜索数据源 (2).打开数据源配置后点击添加,选择sql server点击 ...
- 巧用五招提升Discuz!X运行速度
Discuz!X使用的是数据库应用程序,所以,当数据库的大小.帖子的数目.会员的数目,这些因素都会影响到程序的检索速度,尤其是当论坛的影响力大了,这个问题就更为突出了,虽然,康盛对Discuz进行了更 ...
- VS2015 +Qt5 串口工具
简单的小工具是VS2015 + Qt5.6.1实现的,界面部分是Qt实现,串口是封装的WinAPI,把串口收发模块封装成了个Serialport.dll 供Qt界面调用. 由于VS2015需要CRT运 ...
- bzoj1041题解
求一个给定的圆(x^2+y^2=r^2),在圆周上有多少个点的坐标是整数.r<=2000 000 000 这道题刚看时,就明白暴力不能解决一切.要是r^2<=20亿,还可以sqrt循环, ...