启用nginx status状态详解
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了启用nginx status状态详解相关的知识,希望对你有一定的参考价值。
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
[[email protected] ~]# 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状态详解的主要内容,如果未能解决你的问题,请参考以下文章