[WEB] nginx的stub_status狀態信息解釋
一、加載http_stub_status模塊
[root@10.10.90.97 ~]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module [root@10.10.90.97 ~]# make && make install |
二、修改nginx配置文件
在server中,添加如下代碼: location /NginxStatus { stub_status on; access_log on; auth_basic "NginxStatus"; auth_basic_user_file htpasswd; } [root@10.10.90.97 ~]# htpasswd -c /usr/local/nginx/conf/htpasswd nginx_focus #連續輸入兩次密碼 New password: Re-type new password: Adding password for user nginx_focus |
[root@10.10.90.97 ~]# kill -USR1 `cat /usr/local/nginx/logs/nginx.pid` |
三、打開nginx的stub_status可以通過頁面鏈接看到如下信息:
Active connections: 145 server accepts handled requests 1749 1749 3198 Reading: 0 Writing: 3 Waiting: 142 |
Active connections:145 #nginx 正處理的活動連接數145個。 server accepts handled requests 1749 1749 3198 #nginx啟動到現在共處理了 1749個連接 ,nginx啟動到現在共成功創建 1749次握手 請求丟失數=(握手-連接),可以看出,我們沒丟請求;總共處理了3198 次請求。 Reading: 0 Writing: 3 Waiting: 142 #Reading :nginx讀取到客戶端的Header信息數。 #Writing : nginx返回給客戶端的Header信息數。 #Waiting : Nginx已經處理完正在等候下一次請求指令的駐留連接.開啟keep-alive的情況下,這個值等於active–(reading+writing)。 |