Nginx流量带宽等请求状态统计
( ngx_req_status)
插件下载地址:
wget http://nginx.org/download/nginx-1.4.2.tar.gz git clone https://github.com/zls0424/ngx_req_status.git
配置示例:
1、服务目录 mkdir /opt/server 2、补丁导入; patch -p1 < /opt/server/ngx_req_status/write_filter-VERSION.patch tar -xf http://nginx.org/download/nginx-1.4.2.tar.gz -C /opt/server cd /opt/server/nginx ./configure --prefix=/opt/server/nginx-1.4.2 --add-module=/opt/server/ngx_req_status-master make -j2 // 处理器的多核作业; make install 3、nginx http 模块配置; http { req_status_zone server_name $server_name 256k; req_status_zone server_addr $server_addr 256k; req_status_zone server_url $server_name$uri 256k; req_status server_name server_addr server_url; server { lisent 80; server_name localhost; location /req-status { req_status_show on; } } }
查看 :
curl http://127.0.0.1/req-status 参数: key路径 max_active 最大连接数 max_bw 最大带宽 traffic 访问量 requests 请求数 active 连接数 bandwidth 网络带宽
[[email protected] nginx-1.4.2]# curl http://127.0.0.1/req-status zone_name key max_active max_bw traffic requests active bandwidth server_addr 10.10.10.100 1 31K 3M 593 0 0 server_addr 127.0.0.1 1 8480 206K 40 1 0 server_name localhost 1 30K 3M 600 1 0 server_name www.hktest.com 1 8424 78K 33 0 0 server_url localhost/ 1 352 18K 6 0 0 server_url localhost/hktest-status 1 9968 91K 45 0 0 server_url localhost/favicon.ico 1 352 9192 3 0 0 server_url localhost/req-status 1 8480 206K 40 1 0 server_url localhost/req-status/ 1 30K 2M 506 0 0 server_url www.hktest.com/hktest-status 1 8424 78K 33 0 0
时间: 2024-10-10 14:18:47