httpd开启status模块_Nginx性能统计模块http_stub_status_module使用

无论是编译安装还是yum安装 都是有可能加载http_stub_status_module模块

--with-http_stub_status_module

主要用于查看Nginx的一些状态信息.

模块的语法格式,

Syntax: stub_status
Default: -
Context: server,location

这个模块的作用于只能在server,location段。

在server段中添加一个status就可以了,注意这个status是随意起的名字,然后保存从其nginx服务。

[root@VM_159_140_centos www]# vi /etc/nginx/conf.d/default.conf

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/host.access.log  main;

   location /status{
      stub_status on;
   }

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }


    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

}

访问127.0.0.1/status

69d075688a045194fa62e4f4c5d358a1.png

页面的参数介绍

Active connections: 1 
server accepts handled requests
 20 20 69 
Reading: 0 Writing: 1 Waiting: 0 

Active connections: 1当前活动的连接数

20 总连接数connection

20 成功的连接数connection 失败连接=(总连接数-成功连接数)

69 总共处理的请求数requests

Reading: 0 读取客户端Header的信息数 请求头

Writing: 1 返回给客户端的header的信息数 响应头

Waiting: 0 等待的请求数,开启了keepalive

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值