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时间很长,但是中间相当一段时间没去配置,这次算是重新 ...
随机推荐
- root权限下找不到 /root/.ssh目录
Xshell配置ssh登陆远程服务器,找不到 root/.ssh目录,报错信息如下: root@ubuntu:/home/xinxin# cd /root/.ssh/bash: cd: /root/. ...
- CentOS yum 安装 PHP 5.6.24
配置yum源 追加CentOS 6.5的epel及remi源. # rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel- ...
- Spring Boot 集成 Mybatis
原文:https://github.com/x113773/testall/issues/9 方式一:mybatis-spring-boot-starter---这种方式比较简单,具体步骤如下:1. ...
- 【LeetCode】94. Binary Tree Inorder Traversal
题目: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary ...
- 如何在自己的网页上插入一个超链接,发起临时qq会话
1.先开通临时会话功能 打开网页http://shang.qq.com/v3/index.html
- [翻译]成为顶尖程序员应当学什么?Python、C还是Ruby?
原文地址(墙外):https://medium.com/life-tips/should-you-learn-python-c-or-ruby-to-be-a-top-coder-infographi ...
- Openfire4源码部署到eclipse中并编译
Openfire4源码部署到eclipse中并编译 概述 Openfire是众所周知的基于xmpp协议的IM开源服务,所有操作,配置,监控,调试等以B/S方式进行展示,非常的方便管理员进行管理.它的强 ...
- readSerializableObj
package JBJADV003;import java.io.*;public class readSerializableObj { public static void main(String ...
- js 监控iframe URL的变化
iframe的url可以前端任何地址,这样就可能出现漏洞,如果钓鱼网站通过js把src改成了危险地址,如果没有监控,就会有很大隐患.所以监控iframe的url变化就是必须要解决的问题了. 第一印象的 ...
- Jenkins-FQA
1.svn url不能设置成文件路径,而应该是"文件夹"路径,也就是说必须是目录. 示例: Checking out https://svn.gw.com.cn:10000/svn ...