php-fpm提供了状态输出,可以通过它来做些监控
vi php-fpm.conf
# status
pm.status_path = /php_status
# ping
ping.path = /php_ping
vi nginx/conf/fastcgi_params
# 添加
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
server
{
listen 80;
server_name localhost;
location ~ ^/(php_status|php_ping)$
{
access_log off;
allow 127.0.0.1;
deny all;
include fastcgi_params;
fastcgi_pass 127.0.0.1:10080;
}
}
这样就可以了,测试
curl http://localhost/php_status
curl http://localhost/php_ping