nginx添加http_stub_status查看并发等
2013-06-07 15:32
627 查看
说明:
http_stub_status模块能够获取Nginx的并发连接,请求等。
因 此模块非核心模块,所以需要在编译的时候需手动添加编译参数--with-http_stub_status_module
实现:
1.编辑nginx.conf文件,添加以下内容
2.重启nginx
3.测试and参数说明
浏览器地址栏输入www.nobody.com/nginx_status,可以看到"stub status" 模块返回的状态信息跟 mathopd's 的状态信息很相似.
返回的状态信息如下:
Active connections: 291
server accepts handled requests
: 16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
active connections -- 对后端发起的活动连接数
server accepts handled requests -- nginx 总共处理了 16630948 个连接, 成功创建 16630948 次握手 (证明中间没有失败的), 总共处理了 31070465 个请求 (平均每次握手处理了 1.8个数据请求)
reading -- nginx 读取到客户端的Header信息数
writing -- nginx 返回给客户端的Header信息数
waiting -- 开启 keep-alive 的情况下,这个值等于 active - (reading + writing),意思就是Nginx说已经处理完正在等候下一次请求指令的驻留连接
附录:
这两个网址是讲得还不错,先放这存着
http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/ http://dev.2xlp.com/svn/nginx_config/trunk/conf/_rrd/__README__.txt
转自:转载请注明: nginx添加http_stub_status查看并发等 | GainGreat.com +复制链接
http_stub_status模块能够获取Nginx的并发连接,请求等。
因 此模块非核心模块,所以需要在编译的时候需手动添加编译参数--with-http_stub_status_module
#/usr/local/nginx/sbin/nginx -V ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
实现:
1.编辑nginx.conf文件,添加以下内容
#vim /usr/local/nginx/conf/nginx.conf location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; //本机测试需添加此条记录 deny 192.168.1.1; allow 192.168.1.0/24; //允许192.168.1.0/24访问,拒绝192.168.1.1访问 allow 10.1.1.0/16; allow 2620:100:e000::8001; //此处是ipv6的地址 deny all; //除了上述地址,拒绝所有连接。写allow,deny时,注意顺序 }
2.重启nginx
/usr/local/nginx/sbin/nginx -t //测试配置是否正确 /usr/local/nginx/sbin/nginx -s reload
3.测试and参数说明
浏览器地址栏输入www.nobody.com/nginx_status,可以看到"stub status" 模块返回的状态信息跟 mathopd's 的状态信息很相似.
返回的状态信息如下:
Active connections: 291
server accepts handled requests
: 16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106
active connections -- 对后端发起的活动连接数
server accepts handled requests -- nginx 总共处理了 16630948 个连接, 成功创建 16630948 次握手 (证明中间没有失败的), 总共处理了 31070465 个请求 (平均每次握手处理了 1.8个数据请求)
reading -- nginx 读取到客户端的Header信息数
writing -- nginx 返回给客户端的Header信息数
waiting -- 开启 keep-alive 的情况下,这个值等于 active - (reading + writing),意思就是Nginx说已经处理完正在等候下一次请求指令的驻留连接
附录:
这两个网址是讲得还不错,先放这存着
http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/ http://dev.2xlp.com/svn/nginx_config/trunk/conf/_rrd/__README__.txt
转自:转载请注明: nginx添加http_stub_status查看并发等 | GainGreat.com +复制链接
相关文章推荐
- 解剖Nginx·模块开发篇(5)解读内置非默认模块 ngx_http_stub_status_module
- nginx监控模块http_stub_status_module安装
- 编译安装 nginx的http_stub_status_module监控其运行状态
- nginx模块学习一 http_stub_status_module 客户端连接状态
- Nginx服务器工作状态ngx_http_stub_status_module 模块
- Nginx内置状态信息(http_stub_status)
- 解剖Nginx·模块开发篇(5)解读内置非默认模块 ngx_http_stub_status_module
- Nginx性能统计模块http_stub_status_module使用
- Nginx-解读内置非默认模块 ngx_http_stub_status_module
- 监控Nginx服务器工作状态ngx_http_stub_status_module 模
- NGINX服务器工作状态NGX_HTTP_STUB_STATUS_MODULE 模块
- 【记录】Nginx添加stub_status后,启动报错
- 在CentOS 6.9 x86_64上开启nginx 1.12.2的stub_status模块(ngx_http_stub_status_module)监控
- nginx统计响应的http状态码信息(ngx-http-status-code-counter)
- 给已经编译安装了的nginx 添加http_ssl_module模块
- Genymotion添加模拟器时报“Unable to create virtual device,Server returned HTTP status code 0”
- nginx的stub_status状态信息解释
- 二十.stub_status模块功能(ngx_http_stub_status_module)
- 怎么查看nginx已经启动成功并且添加自动开机启动