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时间很长,但是中间相当一段时间没去配置,这次算是重新 ...
随机推荐
- LinCode 刷题 之二叉树最小深度
http://www.lintcode.com/zh-cn/problem/minimum-depth-of-binary-tree/ 题目描述信息 /** * Definition of Tree ...
- php生成Excel表格
//引用新建对象<br>require "../phpexcel/Classes/PHPExcel.php"; $excel = new PHPExcel(); 建表格 ...
- JS函数和对象(一)
在本文章中,将对JS中的函数和对象进行一些讲解,不对之处还请之处 一.JS中的函数 1.1无参函数 其形式如下代码所示 function box(){ alert("我是一个函数,只有被调用 ...
- 用py2exe将python文件转换成exe可执行程序
1.首先需要安装py2exe模块,下载地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/ 然后用pip install 命令安装py2exe模块,如果你用的py ...
- 【SEO】搜索引擎优化的陷阱和作弊
一.认识SEO [理解] 站内优化是指更改网站内部结构,让网站利于蜘蛛爬取,比如网站内容: 站外优化是指发反向链接,给蜘蛛一个爬取你网站的通道. 其中,反向链接是指网页A 上有一个链接指向网页B,则网 ...
- 本地服务器 windows server 2008 datacenter conn /as sysdba 提示 ora-01031 insufficient privileges
原因是需要把当前用户administrator(为例)添加到ora_dba组里. 服务器管理器--配置--本地用户和组--组
- (转载)oracle的v$sqlarea表
原文摘自:http: [V$SQLAREA] 本视图持续跟踪所有shared pool中的共享cursor,在shared pool中的每一条SQL语句都对应一列.本视图在分析SQL语句资源使用方面 ...
- 使用gulp实现文件压缩及浏览器热加载
一.安装gulp 首先,你要安装过nodejs,如果没有安装过的同学请自行下载. 先再命令行里输入 npm install gulp -g 下载gulp 二.创建gulp项目 创建一个你需要 ...
- Socket异步通信及心跳包同时响应逻辑分析。
有段时间没有更博了,刚好最近在做Socket通信的项目,原理大致内容:[二维码-(加logo)]-->提供主机地址和端口号信息(直接使用[ThoughtWorks.QRCode.dll]比较简单 ...
- 拥抱.NET Core系列:Logging (1)
在之前我们简单介绍了 .NET Core 中的 DI组件,没来及了解的童鞋可以翻翻我之前的文章. 接下来会对 .NET Core 中的 Logging 进行介绍. 本文中使用了"Micros ...