Nginx性能统计模块http_stub_status_module使用


1、进入nginx源码目录,重新配置编译参数

./configure --prefix=/usr/local/nginx/ --with-http_stub_status_module

2、重新编译安装

make && make install

3、重启nginx

pkill -9 nginx /usr/local/nginx/sbin/nginx

4、为了便于在网页上查看统计信息,在配置文件nginx.conf中加入

location /status {
      stub_status on;
      access_log off;
allow 127.0.0.1;
    deny all; }

5、重新加载nginx

/usr/local/nginx/sbin/nginx -s reload

6、页面查看地址:http://ip/status

统计结果类似:

Active connections: 2001 
server accepts handled requests
 303662 303484 209204 
Reading: 0 Writing: 1073 Waiting: 928 

7、为了使nginx能够相应足够多的请求,要保证系统可同时打开文件数量足够多

ulimit -n 20480

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM