php fpm 统计,php实现fpm开启状态统计的方法
這篇文章主要給大家介紹了php-fpm開啟狀態(tài)統(tǒng)計的方法,文中介紹的非常詳細(xì),對大家具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起看看吧。
本文主要給大家介紹了關(guān)于php-fpm開啟狀態(tài)統(tǒng)計的相關(guān)內(nèi)容,分享出來供大家參考學(xué)習(xí),下面來一起看看詳細(xì)的介紹:
啟用php-fpm狀態(tài)功能
$ cat /usr/local/php/etc/php-fpm.conf | grep status
pm.status_path = /php-fpm_status
nginx配置
默認(rèn)主機(jī)里面加上location
location ~ ^/(php-fpm_status|ping) {
fastcgi_pass unix:/dev/shm/php-cgi.sock; //如果你不是用的sock,改為對應(yīng)端口
include fastcgi.conf;
access_log off;
allow 127.0.0.1;
deny all;
}
訪問測試
$ curl 127.0.0.1/php-fpm_status
pool: www
process manager: dynamic
start time: 12/May/2017:13:12:55 +0800
start since: 25552
accepted conn: 8649
listen queue: 0
max listen queue: 0
listen queue len: 0
idle processes: 13
active processes: 1
total processes: 14
max active processes: 7
max children reached: 0
slow requests: 0
php-fpm status詳解pool - fpm池子名稱,大多數(shù)為www
process manager – 進(jìn)程管理方式,值:static, dynamic
start time – 啟動日期,如果reload了php-fpm,時間會更新
start since – 運(yùn)行時長
accepted conn – 當(dāng)前池子接受的請求數(shù)
listen queue – 請求等待隊(duì)列,如果這個值不為0,那么要增加FPM的進(jìn)程數(shù)量
max listen queue – 請求等待隊(duì)列最高的數(shù)量
listen queue len – socket等待隊(duì)列長度
idle processes – 空閑進(jìn)程數(shù)量
active processes – 活躍進(jìn)程數(shù)量
total processes – 總進(jìn)程數(shù)量
max active processes – 最大的活躍進(jìn)程數(shù)量(FPM啟動開始算)
max children reached - 大道進(jìn)程最大數(shù)量限制的次數(shù),如果這個數(shù)量不為0,那說明你的最大進(jìn)程數(shù)量太小了,請改大一點(diǎn)。
slow requests – 啟用了php-fpm slow-log,緩慢請求的數(shù)量
php-fpm其他參數(shù)
php-fpm狀態(tài)頁比較個性化的一個地方是它可以帶參數(shù),可以帶參數(shù)json、xml、html并且前面三個參數(shù)可以分別和full做一個組合
請自行嘗試url?php-fpm_status?json
相關(guān)推薦:
總結(jié)
以上是生活随笔為你收集整理的php fpm 统计,php实现fpm开启状态统计的方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 并行算法 Parallel Algori
- 下一篇: php文本框自动补全,PHP自动补全表单