当前位置: 移动技术网 > 科技>操作系统>Linux > Nginx状态信息(status)配置及信息详解

Nginx状态信息(status)配置及信息详解

2019年01月09日  | 移动技术网科技  | 我要评论

谁和她睡了,夕阳之约图片,安徽滁州中考成绩查询

nginx状态信息功能的介:

  nginx 在编译安装 nginx 的时候添加 --with-http_stub_status_module 参数,其功能是记录 nginx 的基本访问状态信息,让使用者了解 nginx 的工作状态,

可以用 /application/nginx/sbin/nginx -v 来查看是否添加了ngx_http_stub_status_module 模块。

例如:

 1、新建一个虚拟主机来配置 nginx 状态信息功能

cat  >>/application/nginx/conf/extra/status.conf<<eof
##status
server{
    listen 80;
server_name status.jyw1.com;
location  /  {
stub_status on;
access_log off;
 }
}
eof

2、修改nginx.conf配置文件

[root@lamp01 conf]# cat nginx.conf
worker_processes 1; error_log logs/error.log error; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; #nginx vhosts config include extra/www.conf; include extra/bbs.conf; include extra/status.conf; access_log logs/access_www.log main; }

 

3、刷新配置:

[root@lamp01 conf]# /application/nginx/sbin/nginx -t
nginx: the configuration file /application/nginx-1.6.3/conf/nginx.conf syntax is ok
nginx: configuration file /application/nginx-1.6.3/conf/nginx.conf test is successful
[root@lamp01 conf]# /application/nginx/sbin/nginx -s reload

4、修改本地 hosts解析

echo "192.168.43.118 status.jyw1.com" >>/etc/hosts

5、测试效果:

状态信息解释:

  • active connections :表示 nginx 正在处理的活动连接数有多少个
  • server :表示 nginx 启动到现在共处理了多少个连接
  • accepts :表示 nginx 启动到现在共成功创建了多少次握手
  • handled requests : 表示总共处理了多少次请求
  • reading :表示 nginx 读取到客户端的 header 信息数
  • writing :表示 nginx 返回给客户端的 header 信息数
  • waiting :表示 nginx 已经处理完正在等候下一次请求指令的驻留连接数

在开启 keep-alive 的情况下,waiting = active connections - (reading + writing)

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网