nginx配置查看http运行请求状态

Stub Status模块(Stub Status),这个模块可以取得一些nginx的运行状态。
要使用这个模块必须在编译时指定下列编译参数:

  1. --with-http_stub_status_module

示例配置:

  1. location /nginx_status {
  2.   stub_status on;
  3.   access_log   off;
  4. }

这个模块可以生成一个类似mathopd状态页面的纯文本信息:

  1. Active connections: 291
  2. server accepts handled requests
  3.   16630948 16630948 31070465
  4. Reading: 6 Writing: 179 Waiting: 106

active connections – 所有打开的连接,包括连接到后端服务器的。
server accepts handled requests – nginx已经接受并处理16630948个连接,31070465个请求(每个连接1.8个请求)。
reading – 正在读取的请求头。
writing – 正在读取的请求主体,正在处理的请求或者正在写入的应答。
waiting – keepalive连接数,等于active – (reading + writing)。

标签:Nginx 发布于:2019-11-24 15:21:03