Linux系统中的iostat是I/O statistics(输入/输出统计)的缩写,iostat工具将对系统的磁盘操作活动进行监视。它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况。同vmstat一样,iostat也有一个弱点,就是它不能对某个进程进行深入分析,仅对系统的整体情况进行分析。
本文包括iostat的安装、用法、常用参数和解析。
1、安装
看提供iostat的软件包
[root@devvm ~]# yum provides */iostat Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.bupt.edu.cn * extras: ftp.sjtu.edu.cn * updates: ftp.sjtu.edu.cn pcp-4.3.2-12.el7.x86_64 : System-level performance monitoring and performance managementRepo : base Matched from:Filename : /var/lib/pcp/config/pmlogconf/tools/iostat pcp-4.3.2-13.el7_9.x86_64 : System-level performance monitoring and performance managementRepo : updates Matched from:Filename : /var/lib/pcp/config/pmlogconf/tools/iostat pcp-testsuite-4.3.2-12.el7.x86_64 : Performance Co-Pilot (PCP) test suiteRepo : base Matched from:Filename : /var/lib/pcp/testsuite/sadist/iostat pcp-testsuite-4.3.2-13.el7_9.x86_64 : Performance Co-Pilot (PCP) test suiteRepo : updates Matched from:Filename : /var/lib/pcp/testsuite/sadist/iostat sysstat-10.1.5-19.el7.x86_64 : Collection of performance monitoring tools for LinuxRepo : base Matched from:Filename : /usr/bin/iostat[root@devvm ~]#
可以选择pcp或sysstat
[root@devvm ~]# yum install sysstat -y Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.bupt.edu.cn * extras: ftp.sjtu.edu.cn * updates: ftp.sjtu.edu.cn Resolving Dependencies--> Running transaction check---> Package sysstat.x86_64 0:10.1.5-19.el7 will be installed--> Processing Dependency: libsensors.so.4()(64bit) for package: sysstat-10.1.5-19.el7.x86_64--> Running transaction check---> Package lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.el7 will be installed--> Finished Dependency Resolution Dependencies Resolved======================================================================================================= Package Arch Version Repository Size=======================================================================================================Installing: sysstat x86_64 10.1.5-19.el7 base 315 k Installing for dependencies: lm_sensors-libs x86_64 3.4.0-8.20160601gitf9185e5.el7 base 42 k Transaction Summary=======================================================================================================Install 1 Package (+1 Dependent package)Total download size: 357 k Installed size: 1.2 MDownloading packages:(1/2): lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64.rpm | 42 kB 00:00:00 (2/2): sysstat-10.1.5-19.el7.x86_64.rpm | 315 kB 00:00:00 -------------------------------------------------------------------------------------------------------Total 1.1 MB/s | 357 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64 1/2 Installing : sysstat-10.1.5-19.el7.x86_64 2/2 Verifying : sysstat-10.1.5-19.el7.x86_64 1/2 Verifying : lm_sensors-libs-3.4.0-8.20160601gitf9185e5.el7.x86_64 2/2 Installed: sysstat.x86_64 0:10.1.5-19.el7 Dependency Installed: lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.el7 Complete![root@devvm ~]#