• 幕客老师召集小伙伴
  • 运维高手36项修炼
  • python自动化运维项目实战
  • nginx从入门到实战
  • 阿里云与Centos7实战

nginx-查看Nginx的状态

查看Nginx的状态
========================================================

一、编译安装Nginx时
–with-http_stub_status_module

二、配置Nginx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# vim /usr/local/nginx/conf/nginx.conf
server {
        listen       80;
        server_name  localhost;
        #charset koi8-r;
        #access_log  logs/host.access.log  main;
 
        location / {
            root   html;
            index  index.html index.htm index.php;
        }
 
        location /nginx_status {
                stub_status on;
                allow all;
        }
}
1
2
3
4
5
6
7
8
9
10
[root@jeson ~]# killall nginx
[root@jeson ~]# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@jeson ~]# /usr/local/nginx/sbin/nginx
[root@jeson ~]# firefox http://192.168.2.253/nginx_status &
Active connections: 22    #当前活跃的连接数
server accepts handled requests      
 27 27 434
Reading: 2 Writing: 1 Waiting: 19

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

 

nginx-查看Nginx的状态

Pingbacks已打开。

引用地址

暂无评论

发表评论