Linux 性能工具 - sar学习

简介

sar是一款在linux下的性能工具,可以观察到CPU,内存,IO,运行队列,每秒上下文切换等信息。

软件工具安装

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

源码安装

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

测试版本

统计信息

1)CPU统计信息

1 #sar 1 33 times with 1 second each time

2)内存空闲与使用率

3)已使用的Swap空间

4)综合I/O活动数据

5)独立块设备I/O活动数据

6)同时显示实际设备名字

7)展示每秒上下文切换

8)运行队列与负载报告

9)其他功能,请 man sar

 

posted @ 2016-04-07 23:30  loadofleaf  Views(356)  Comments(0Edit  收藏  举报