Linux 下使用 NMON 分析系統效能(其他如dstat、iostat)

來源:互聯網
上載者:User
http://pkgs.repoforge.org/dstat/下載相應 CPU 類型的版本:

http://nmon.sourceforge.net/pmwiki.php?n=Site.Download

wget http://sourceforge.net/projects/nmon/files/download/nmon_x86_12a.zip/download
unzip nmon_x86_12a.zip
Archive:  nmon_x86_12a.zip
  inflating: nmon_x86_rhel45
  inflating: nmon_x86_rhel52
  inflating: nmon_x86_sles9
  inflating: nmon_x86_sles10
  inflating: nmon_x86_ubuntu810
  inflating: nmon_x86_fedora10
  inflating: nmon_x86_opensuse10nmon_x86_centos6 
nmon_x86_64_centos6 

使用對應的作業系統檔案:
chmod +x nmon_x86_ubuntu810
mv nmon_x86_ubuntu810 /usr/local/bin/nmon

對於 Debian 還要做以下操作(不做也同樣能運行):
apt-get install lsb-release
lsb_release -d | sed 's/Description:\t//' > /etc/debian_release

然後直接運行 nmon 即可。

採集資料並產生報表:
採集資料:
nmon -s10 -c60 -f -m /home/

參數解釋:
-s10 每 10 秒採集一次資料。
-c60 採集 60 次,即為採集十分鐘的資料。
-f 產生的資料檔案名中包含檔案建立的時間。
-m 產生的資料檔案的存放目錄。

這樣就會產生一個 nmon 檔案,並每十秒更新一次,直到十分鐘後。
產生的檔案名稱如: hostname_090824_1306.nmon ,"hostname" 是這台主機的主機名稱。

產生報表:
下載 nmon analyser (產生效能報告的免費工具):
http://www.ibm.com/developerworks/wikis/display/Wikiptype/nmonanalyser

把之前產生的 nmon 資料檔案傳到 Windows 機器上,用 Excel 開啟分析工具 nmon analyser v33C.xls 。點擊 Excel 檔案中的 "Analyze nmon data" 按鈕,選擇 nmon 資料檔案,這樣就會產生一個分析後的結果檔案: hostname_090824_1306.nmon.xls ,用 Excel 開啟產生的檔案就可以看到結果了。

如果宏不能運行,需要做以下操作:
工具 -> 宏 -> 安全性 -> 中,然後再開啟檔案並允許運行宏。

自動按天採集資料:
在 crontab 中增加一條記錄:
0 0 * * * root nmon -s300 -c288 -f -m /home/ > /dev/null 2>&1

300*288=86400 秒,正好是一天的資料。

參考資料:
nmon for Linux:
http://nmon.sourceforge.net/pmwiki.php

nmon 效能:分析 AIX 和 Linux 效能的免費工具:
http://www.ibm.com/developerworks/cn/aix/library/analyze_aix/index.html

nmon analyser —— 產生 AIX 效能報告的免費工具:
http://www.ibm.com/developerworks/cn/aix/library/nmon_analyser/index.html

 

from: http://bluedata.org/2009/08/31/linux-nmon/

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.