http://www.ttlsa.com/nginx/nginx-status-detail/
nginx和php-fpm一樣內建了一個狀態頁,對于想了解nginx的狀態以及監控nginx非常有幫助。為了后續的zabbix監控,我們需要先了解nginx狀態頁是怎么回事。
1. 啟用nginx status配置
在默認主機里面加上location或者你希望能訪問到的主機里面。
server {
listen *:80 default_server;
server_name _;
location /ngx_status
{
stub_status on;
access_log off;
#allow 127.0.0.1;
#deny all;
}
}
2. 重啟nginx
請依照你的環境重啟你的nginx
# service nginx restart
# curl http://127.0.0.1/ngx_status
Active connections: 11921
server accepts handled requests
11989 11989 11991
Reading: 0 Writing: 7 Waiting: 42
4. nginx status詳解
active connections – 活躍的連接數量
server accepts handled requests — 總共處理了11989個連接 , 成功創建11989次握手, 總共處理了11991個請求
reading — 讀取客戶端的連接數.
writing — 響應數據到客戶端的數量
waiting — 開啟 keep-alive 的情況下,這個值等于 active – (reading+writing), 意思就是 Nginx 已經處理完正在等候下一次請求指令的駐留連接.
posted on 2017-03-21 11:46
思月行云 閱讀(357)
評論(0) 編輯 收藏 引用 所屬分類:
Nginx\Openresty