welcome to nginx nginx 開啟 stub_status 模組監控

來源:互聯網
上載者:User
Nginx中的stub_status模組主要用於查看Nginx的一些狀態資訊.
本模組預設是不會編譯進Nginx的,如果你要使用該模組,則要在編譯安裝Nginx時指定:

./configure –with-http_stub_status_module

Java代碼

[root@10.10.90.97 ~]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module   [root@10.10.90.97 ~]# make && make install   

查看已安裝的 Nginx 是否包含 stub_status 模組

#/usr/local/nginx/sbin/nginx-Vnginxversion:nginx/0.6.32builtbygcc3.4.620060404(RedHat3.4.6-10)configurearguments:--user=nginx--group=nginx--prefix=/home/nginx--with-http_stub_status_module

可以看到我安裝了這個模組。注意是-V -v的話只會顯示版本nginx version: nginx/0.6.32
開始配置nginx,在server塊中加入location 就行了

server{           location /nginx-status {               allow --------               allow --------//允許的ip               deny all;//               stub_status on;               access_log  off;          }  }  

重啟nginx
killall -s HUP nginx
然後請求www.domain.com/nginx-status 就行了,下面是結果

Active connections: 5server accepts handled requests   597080614359708061437560482010Reading: 0 Writing: 5 Waiting: 0

Active connections: 對後端發起的活動串連數.
Server accepts handled requests: Nginx總共處理了38810620個串連,成功建立38810620次握手(證明中間沒有失敗的),總共處理了298655730個請求.
Reading: Nginx 讀取到用戶端的Header資訊數.
Writing: Nginx 返回給用戶端的Header資訊數.
Waiting: 開啟keep-alive的情況下,這個值等於 active – (reading + writing),意思就是Nginx已經處理完成,正在等候下一次請求指令的駐留串連.
所以,在訪問效率高,請求很快被處理完畢的情況下,Waiting數比較多是正常的.如果reading +writing數較多,則說明並發訪問量非常大,正在處理過程中.

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('
  • ').text(i)); }; $numbering.fadeIn(1700); }); });

    以上就介紹了welcome to nginx nginx 開啟 stub_status 模組監控,包括了welcome to nginx方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.