【收录】Nginx 状态监控

Posted on 2013-03-17 22:47  LSX  阅读(134)  评论(0编辑  收藏  举报

» 作者:LSX

» 原创文章版权归作者所有,未经作者同意请保留以下声明.

» 本文链接:http://blog.lishixin.net/?p=1219

» 转载请注明来源:LSX·Blog » 《【收录】Nginx 状态监控》

通过查看Nginx的并发连接,我们可以更清楚的知道网站的负载情况。Nginx并发查看有两种方法(之所以这么说,是因为笔者只知道两种),一种是通过web界面,一种是通过命令,web查看要比命令查看显示的结果精确一些。下面介绍这两种查看方法

No1、通过浏览器查看

通过web界面查看时Nginx需要开启status模块,也就是安装Nginx时加上

--with-http_stub_status_module

然后配置Nginx.conf,在server点里面加入如下内容

location /nginx_status { stub_status on;allow 192.168.1.100; deny all; }

配置完后重新启动Nginx后

我们可以通过浏览器访问http://localhost/status 查看,如下样式

 

Active connections:1 server accepts handled requests 8 8 500 Reading:0 Writing:1 Waiting:0

Copyright © 2024 LSX
Powered by .NET 8.0 on Kubernetes