首页 > 其他 > 详细

启用nginx status状态详解

时间:2018-02-06 16:30:43      阅读:195      评论:0      收藏:0      [点我收藏+]
1、安装nginx

 rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install nginx -y

systemctl start nginx


2、启动nginx status

vi /etc/nginx/nginx.conf


http {

    include       /etc/nginx/mime.types;

    default_type  application/octet-stream;


    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

                      '$status $body_bytes_sent "$http_referer" '

                      '"$http_user_agent" "$http_x_forwarded_for"';


    access_log  /var/log/nginx/access.log  main;


    sendfile        on;

server {

    listen  *:80 default_server;

    server_name _;

    location /ngx_status

    {

        stub_status on;

        access_log off;

        #allow 127.0.0.1;

        #deny all;

    }

}

    #tcp_nopush     on;

修改后保存


systemctl restart nginx

[root@localhost ~]# curl http://192.168.0.115/ngx_status

Active connections: 1 

server accepts handled requests

 11 11 29 

Reading: 0 Writing: 1 Waiting: 0 


nginx status详解

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


启用nginx status状态详解

原文:http://blog.51cto.com/kmt1994/2069474

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