nginx status显示结果详解
[root@a1 ~]# http://127.0.0.1/nginx_status
-bash: http://127.0.0.1/nginx_status: 没有那个文件或目录
[root@a1 ~]# curl http://127.0.0.1/nginx_status
Active connections: 1 #表示nginx正在处理的活动连接数有多少个。
server accepts handled requests
8217548 8217548 1188288
Reading: 0 Writing: 1 Waiting: 0
##################################
#server:表示nginx启动到现在共处理了多少个连接
#accepts:表示nginx启动到现在共成功创建了多少次握手(备注:请求丢失数=握手数-连接数)
#handled requests:表示总共处理了多少次请求
##################################
Reading:为nginx读取到客户端的Header信息数
Writing:为nginx返回给客户端的Header信息数
Waiting: 为nginx已经处理完正在等待下一次请求指令的驻留连接,在开启keep-alive的情况下。这个值等于
active - (Reading+Writing)
#########a1###########
#过滤查看连接数
[root@a1 ~]# curl http://127.0.0.1:80/nginx_status 2>/dev/null|grep "Active"|awk '{print $NF}'
3
#########a2###########
[root@a2 ~]# curl http://127.0.0.1:80/nginx_status
Active connections: 1
server accepts handled requests
8219453 8219453 1027236
Reading: 0 Writing: 1 Waiting: 0