0
点赞
收藏
分享

微信扫一扫

Nginx架构篇(9)启动php状态监控页面功能

sin信仰 2022-06-08 阅读 61

1.启动测试页功能

vim  /etc/php-fpm.d/www.conf

2.nginx配置页面转发

vim /etc/nginx/conf.d/default.conf

        location = /php_status {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
include fastcgi_params;
}

fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;

   这个配置的意思是 在浏览器中访问的.php文件,实际读取的是 $document_root(网站根目录)下的.php文件 -- 也就是说当访问127.0.0.1/index.php的时候,需要读取网站根目录下面的index.php文件,如果没有配置这一配置项时,nginx不回去网站根目录下访问.php文件,所以返回空白

include fastcgi_params是常用变量所在的文件名。

systemctl restart nginx
systemctl restart php-fpm

3.访问测试页 :ip/php_status

Nginx架构篇(9)启动php状态监控页面功能_linux

  • 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,缓慢请求的数量
举报

相关推荐

0 条评论