关于nginx状态监控字段的个人见解(求真相)

今天看到了马哥视频其中一节对nginx状态监控信息的介绍,对视频ppt上的监控字段解析产生了一些疑问,ppt内容如下:

active connections – 活跃的连接数量
server accepts handled requests — 总共处理了xxx个连接 , 成功创建xxx次握手, 总共处理了xxx个请求
reading — 读取客户端的连接数.
writing — 响应数据到客户端的数量
waiting — 开启 keep-alive 的情况下,这个值等于 active – (reading+writing), 意思就是 Nginx 已经处理完正在等候下一次请求指令的驻留连接.

一开始是基于对上面介绍的连接和请求的区别不理解,于是进行了谷百,得到的解析基本与上面的介绍一致,依然没有解决心中的疑问,最后翻阅了一下nginx的官方文档,找到了相关的说明,并斗胆的进行了一些自我揣测,得出的答案与上面介绍有较大的出入,因此觉得有必要发篇博文出来与大家讨论一下,也是出于对知识真相渴望!如有不正确的地方欢迎大家批评指正。官方原文及个人翻译如下:

ngx_http_stub_status_module模块提供了nginx基础状态信息的访问接口。这个模块默认不编译,需要通过–with-http_stub_status_module配置参数开启。


Example Configuration

location /basic_status {
   stub_status;
}

上面的配置会创建一个简单页面来展示nginx的基础状态信息,显示格式如下:

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

    The current number of active client connections including Waiting connections.(原文)

    当前的客户端活动连接数(包含正在等待的客户端连接),即相当于连接状态处于Established和SYN_ACK的tcp连接

  • accepts

    The total number of accepted client connections.(原文)

    已接受的客户端连接总数,即已被worker进程接收的连接

  • handled

    The total number of handled connections. Generally, the parameter value is the same as acceptsunless some resource limits have been reached (for example, the worker_connections limit).(原文)

    已被处理的连接总数。其值一般与accepts相等,除非受到了某些资源的限制,如:设置了worker_connections的数量限制

  • requests

    The total number of client requests.

    客户端的http请求总数

  • Reading

    The current number of connections where nginx is reading the request header.

    当前正在读取的http请求数(读取到http请求首部)

  • Writing

    The current number of connections where nginx is writing the response back to the client.

    当前准备响应的连接数(nginx正在写入http响应首部)

  • Waiting

    The current number of idle client connections waiting for a request.

    当前处于等待的空闲客户端请求数。等待的时间为Reading和Writing之间的间隔

  • ngx_http_stub_status_module支持以下内建变量(1.3.14版本后):


原创文章,作者:gateray,如若转载,请注明出处:http://www.178linux.com/24090

(3)
gateraygateray
上一篇 2016-07-12 11:24
下一篇 2016-07-16 14:41

相关推荐

  • LVS类型及其调度算法

    LVS类型:     NAT:–>(DNAT) (多目标的DNAT)     DR:     TUN:     FULLNAT: LVS NAT的特性  &nbs…

    Linux干货 2016-10-29
  • linux 故障—-/boot删除 修复

    LINUX        /BOOT        SHANCHU 光盘进入resuce  第①步;修复内核文件 shell start shell 首先先切根 chroot &n…

    Linux干货 2016-09-13
  • MySQL基础入门详解

    MySQL MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,目前属于 Oracle 旗下公司。MySQL 最流行的关系型数据库管理系统,在 WEB 应用方面MySQL是最好的 RDBMS (Relational Database Management System,关系数据库管理系统) 应用软件之一。 想要使用MySQL来存储并操作数…

    2017-09-16
  • MBR&GPT分区基本原理

    1、磁盘系统为什么要分区?     •     优化I/O性能     •     实现磁盘空间配额限制       &…

    Linux干货 2016-08-30
  • 8-4 作业

    1.用正则表达式表示IP地址 2.用正则表达式表示手机号11 13 17 15  18 3.用正则表达式表示身份证号18   4.用正则表达式表示邮箱  

    Linux干货 2016-08-08
  • 启动和内核管理

    启动和内核管理 :      CentOS 5和6的启动流程     服务管理     Grub管理     自制Linux     启动排错 &nb…

    Linux干货 2016-09-19