美文网首页
Nginx启用状态监控

Nginx启用状态监控

作者: ahcj_11 | 来源:发表于2017-08-19 21:57 被阅读19次

标签(空格分隔): nginx


1 在 server 段加上一个location

server {
    listen       80;
    server_name  localhost;
 
    location /ngx_status 
    {
        stub_status on;
        access_log off;
        #allow 127.0.0.1;
        #deny all;
    }
}

2 重载 Nginx 配置

[root@localhost html]# nginx -s reload

3 打开 ngx_status 页面

[root@localhost html]# curl localhost/ngx_status
Active connections: 2 
server accepts handled requests
 5 5 8 
Reading: 0 Writing: 1 Waiting: 1

4 结果祥解

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

相关文章

网友评论

      本文标题:Nginx启用状态监控

      本文链接:https://www.haomeiwen.com/subject/mprxdxtx.html