歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux基礎知識 >> Linux 性能工具 - sar學習

Linux 性能工具 - sar學習

日期:2017/3/2 17:15:29   编辑:Linux基礎知識

簡介

sar是一款在linux下的性能工具,可以觀察到CPU,內存,IO,運行隊列,每秒上下文切換等信息。

軟件工具安裝

#Ubuntu
sudo apt-get install sysstat
# CentOS
yum install sysstat
# CentOS
rpm -ivh sysstat-10.0.0-1.i586.rpm

源碼安裝

 #Download
 wget http://pagesperso-orange.fr/sebastien.godard/sysstat-10.0.0.tar.bz2
 # tar and cd
 tar -xvjf sysstat-10.0.0.tar.bz2
 cd sysstat-10.0.0/
 #configure ("--help"can help you understand the parameters)
 #--enable-install-cron auto startup when linux start
 ./configure --enable-install-cron
 #make
 make
 #make install, sar and  systat tools would be located in /usr/local/bin
 sudo make install

測試版本

統計信息

1)CPU統計信息

 #sar 1 3 (3 times with 1 second each time)

2)內存空閒與使用率

3)已使用的Swap空間

4)綜合I/O活動數據

5)獨立塊設備I/O活動數據

6)同時顯示實際設備名字

7)展示每秒上下文切換

8)運行隊列與負載報告

9)其他功能,請 man sar

Copyright © Linux教程網 All Rights Reserved