首页 > Web开发 > 详细

Nginx 启用ngx_http_stub_status_module 模块实现对Nginx 状态查询

时间:2019-12-26 00:00:54      阅读:118      评论:0      收藏:0      [点我收藏+]

我们通常需要对Nginx 的一些状态进行监控。
nginx 是有一个状态页的.详细介绍见官方文档 :http://nginx.org/en/docs/http/ngx_http_stub_status_module.html

  • 默认情况下,该模块,是没有构建的,需要使用 --with-http_stub_status_module 配置参数启用。

实例配置:

location = /basic_status {
    stub_status;
    allow 127.0.0.1;
    deny all;
}

为了安全起见,我们在后面加了 allow 127.0.0.1,也就是只能是本机访问,不允许其他机器访问。

返回的数据一般为:

Active connections: 291 
server accepts handled requests
 16630948 16630948 31070465 
Reading: 6 Writing: 179 Waiting: 106 

Active connections: 当前活动的客户端连接数,包含Waiting 连接数。

accepts: 接受的客户端连接总数

handled: 已处理的连接总数,通常该参数值与 accepts 应该是一致的,除非得到某个限制(worker_connections).

requests: 客户端请求总数。

Reading: nginx 正在读取请求标头的当前连接数。

Writing: nginx 正在将响应写回到客户端的当前连接数。

Waiting: 当前等待请求的空闲客户端连接数。

Nginx 启用ngx_http_stub_status_module 模块实现对Nginx 状态查询

原文:https://www.cnblogs.com/operationhome/p/12098949.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!