`
wangxe
  • 浏览: 9990 次
  • 来自: ...
社区版块
存档分类
最新评论

用iostat和vmstat监控磁盘性能

阅读更多

vmstat

vmstat提供的数据是基于系统启动后到目前计算的,无法给出当前io运行的统计数据

 

Options

 

Option

Explanation

-D

This displays Linux I/O subsystem total statistics. This option can give you a good idea of how your I/O subsystem is being used, but it won't give statistics on individual disks. The statistics given are the totals since system boot, rather than just those that occurred between this sample and the previous sample.

-d

This option displays individual disk statistics at a rate of one sample per interval . The statistics are the totals since system boot, rather than just those that occurred between this sample and the previous sample.

-p partition

This displays performance statistics about the given partition at a rate of one sample per interval . The statistics are the totals since system boot, rather than just those that occurred between this sample and the previous sample.

interval

The length of time between samples.

count

The total number of samples to take.

 

 

Result Fields:

 

Table 6-3. vmstat Disk I/O Statistics

Statistic

Explanation

disks

The total number of disks in the system.

partitions

The total number of partitions in the system.

total reads

The total number of reads that have been requested.

merged reads

The total number of times that different reads to adjacent locations on the disk were merged to improve performance.

read sectors

The total number of sectors read from disk. (A sector is usually 512 bytes.)

milli reading

The amount of time (in ms) spent reading from the disk.

writes

The total number of writes that have been requested.

merged writes

The total number of times that different writes to adjacent locations on the disk were merged to improve performance.

written sectors

The total number of sectors written to disk. (A sector is usually 512 bytes.)

milli writing

The amount of time (in ms) spent writing to the disk.

inprogress IO

The total number of I/O that are currently in progress. Note that there is a bug in recent versions (v3.2) of vmstat in which this is incorrectly divided by 1,000, which almost always yields a 0.

milli spent IO

This is the number of milliseconds spent waiting for I/O to complete. Note that there is a bug in recent versions (v3.2) of vmstat in which this is the number of seconds spent on I/O rather than milliseconds.

 

Examples

显示IO子系统的整体情况,自从系统启动以后

 

vmstat -D

显示每个磁盘的统计信息, 间隔1s,运行3次

vmstat -d 1 3
 

iostat

iostat可以给出当前运行期间,IO系统的统计信息。

 

下面连个选项比较重要

await  在磁盘队列中的等待时间加上完成磁盘读写的平均时间

svctm  完成磁盘读写的平均时间。相当于 await - 等待时间

 

Fields in Result

Table 6-8. iostat Extended Disk Statistics

Statistic

Explanation

rrqm/s

The number of reads merged before they were issued to the disk.

wrqm/s

The number of writes merged before they were issued to the disk.

r/s

The number of reads issued to the disk per second.

w/s

The number of writes issued to the disk per second.

rsec/s

Disk sectors read per second.

wsec/s

Disk sectors written per second.

rkB/s

Kilobytes read from disk per second.

wkB/s

Kilobytes written to disk per second.

avgrq-sz

The average size (in sectors) of disk requests.

avgqu-sz

The average size of the disk request queue.

await

The average time (in ms) for a request to be completely serviced. This average includes the time that the request was waiting in the disk's queue plus the amount of time it was serviced by the disk.

svctm

The average service time (in ms) for requests submitted to the disk. This indicates how long on average the disk took to complete a request. Unlike await , it does not include the amount of time spent waiting in the queue.

 

Examples

显示基本统计信息

[root@Load1-002 ~]# iostat -d 1 2 
Linux 2.6.29.6-0.6.smp.gcc4.1.x86_64 (Load1-002) 	11/11/2009

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda              69.42         4.91       900.22     935378  171491852
sda1              0.00         0.01         0.00       1912          4
sda2              0.06         1.25        11.06     237784    2106272
sda3             69.36         3.65       889.16     694914  169385576
sdb               0.92         1.25        36.54     237644    6960632
sdb1              0.92         1.24        36.54     236996    6960632
sdc               0.75         0.29        31.33      55204    5968600
sdc1              0.75         0.29        31.33      54556    5968600
sdd               0.73         0.28        29.44      53060    5607992
sdd1              0.73         0.27        29.44      52268    5607992
sde               0.41         0.15         8.61      28996    1639864
sde1              0.41         0.15         8.61      28204    1639864
sdf               0.42         0.14         8.80      27364    1676472
sdf1              0.42         0.14         8.80      26716    1676472
sdg               0.40         0.12         8.51      23388    1620560
sdg1              0.40         0.12         8.51      22740    1620560
sdh               0.40         0.15         8.46      29180    1611384
sdh1              0.40         0.15         8.46      28532    1611384
sdi              19.28         0.68       388.69     128892   74045568
sdi1             19.28         0.67       388.69     128244   74045568
sdj               0.41         0.15         8.56      28068    1629848
sdj1              0.41         0.14         8.56      27276    1629848
sdk               1.72         0.15        66.90      29356   12744208
sdk1              1.72         0.15        66.90      28708   12744208
sdl               0.42         0.12         8.88      23324    1691472
sdl1              0.42         0.12         8.88      22676    1691472
sdm               0.42         0.14         8.87      27476    1689304
sdm1              0.42         0.14         8.87      26828    1689304
sdn               0.41         0.15         8.63      28196    1644344
sdn1              0.41         0.14         8.63      27548    1644344
sdo               0.42         0.14         8.92      27164    1699496
sdo1              0.42         0.14         8.92      26516    1699496
sdp               0.42         0.15         8.74      28516    1665752
sdp1              0.42         0.15         8.74      27868    1665752


... ...
 

 

显示扩展统计信息,间隔5s,100次

iostat -x -dk 5 100
Device:         rrqm/s   wrqm/s     r/s     w/s    rkB/s    wkB/s avgrq-sz avgqu-sz   await  svctm  %util
sda              19.20   338.20    2.80   14.60    88.00  1411.20   172.32     0.05    2.99   2.71   4.72
sda1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sda2             19.20   294.40    2.80    6.40    88.00  1203.20   280.70     0.05    5.30   4.87   4.48
sda3              0.00    43.80    0.00    8.20     0.00   208.00    50.73     0.00    0.39   0.29   0.24
sdb               0.00     1.60    0.00    0.60     0.00     8.80    29.33     0.00    0.00   0.00   0.00
sdb1              0.00     1.60    0.00    0.60     0.00     8.80    29.33     0.00    0.00   0.00   0.00
sdc               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdc1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdd               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdd1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sde               0.00     0.00    2.40    0.00    16.00     0.00    13.33     0.01    5.67   5.67   1.36
sde1              0.00     0.00    2.40    0.00    16.00     0.00    13.33     0.01    5.67   5.67   1.36
sdf               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdf1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdg               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdg1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdh               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdh1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdi               0.00     0.00   25.00    0.00   100.00     0.00     8.00     0.06    2.46   2.46   6.16
sdi1              0.00     0.00   25.00    0.00   100.00     0.00     8.00     0.06    2.46   2.46   6.16
sdj               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdj1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdk               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdk1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdl               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdl1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdm               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdm1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdn               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdn1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdo               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdo1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdp               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
sdp1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00

... ...
 

 

 

 

 

 

 

 

 

 

 

分享到:
评论

相关推荐

    linux 磁盘监控

    linux io测速,iostat硬盘时刻监控各个参数解释,vmstat各个参数解释

    AIX系统磁盘IO监控与评估

    AIX 系统磁盘IO 监控 评估 AIX系统磁盘IO性能评估 2 一, 对磁盘IO的性能考虑, 裸设备优缺点分析 2 1.1 对磁盘IO的性能考虑 2 1.2 裸设备的优点 2 1.3 裸设备的缺点 2 二, IOSTAT工具使用 3 2.1 参数与用法 3 2.2 ...

    搭建nagios监控服务器最佳实践

    1.使用vmstat命令监控内存及磁盘I/O信息 2.使用iostat命令监控CPU处理器及磁盘的I/O信息 3.使用sar命令监控系统最近的CPU/内存等活动

    Linux性能监控工具

    Linux性能监控工具 ...iostat:显示cpu负载和磁盘活动信息, sar:收集和报告系统的状态, mpstat:在多CPUs系统里,它不但能够查看所有CPU的平均状况信息,而且能够查看特定CPU的信息, numastat:NUMA相关统计,

    Linux性能测试工具.docx

    Linux 系统出现问题时,我们不仅需要查看系统日志信息,而且还要使用大量的性能监测工具来判断究竟是哪一部分...iostat CPU 和磁盘平均使用率 vmstat 系统运行状态 在此不一一列举,更多更详细的内容请参阅资源文档

    Linux系统中2个性能监控和优化命令讲解.doc

    Linux系统中的 iostat是I/O statistics(输入/输出统计)的缩写,iostat工具将对系统的磁盘操作活动进行监视。它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况。同vmstat一样,iostat也有一个弱点,...

    几个linux服务器性能测试工具,服务器压力测试

    3、Linux下很全面的监控工具dstat:dstat是一个用来替换 vmstat,iostat netstat,nfsstat和ifstat这些命令的工具, 是一个全能系统信息统计工具. 与sysstat相比, dstat拥有一个彩色的界面, 在手动观察性能状况时, 数据...

    集群好书《高性能Linux服务器构建实战》 试读章节下载

    由国内著名技术社区联合推荐的2012年IT技术力作:《高性能Linux服务器构建实战:运维监控、性能调优与集群应用》,即将上架发行,此书从Web应用、数据备份与恢复、网络存储应用、运维监控与性能优化、集群高级应用等...

    mysql innodb的监控(系统层,数据库层)

    也可以用一些现成的监控工具进行查询,目前用的比较多的innotop、mysqlreport、mtop、mytop,还有淘宝perl语言研发的orzdba。 就监控的指标而言,有系统层面的,数据库层面的。 1、系统层面包括系统的load、cpu、...

    Linux处理性能问题常用命令(物联网后台开发)

    #物联网后台开发Linux下监控调试问题个人...#@磁盘使用,查看占用磁盘最高的是哪个进程 iotop #io性能 每秒显示1次,仅显示3次 iostat -x 1 3 #@dump数据包 tcpdump -nn port 80 tcpdump -nn -c 100 -w 1.cap tcpdum

    Oracle DBA的UNIX袖珍参考手册之服务器监控

    vmstat 是通用的 UNIX 监控工具,vmstat 在 IRIX 操作系统中是 osview。vmstat 的 第一个参数是间隔的秒数,也可以带第二个参数,表明显示多少次。vmstat 不同操 作系统输出结果不一样,含义也可能有区别,具体要看 ...

    Linux 全能系统监控工具dstat的实例详解

    dstat 是一个可以取代vmstat,iostat,netstat和ifstat这些命令的多功能产品。dstat克服了这些命令的局限并增加了一些另外的功能,增加了监控项,也变得更灵活了。dstat可以很方便监控系统运行状况并用于基准测试和...

    (重要)AIX command 使用总结.txt

    可以用该用户登录系统, 使用命令“ulimit -f”和“ulimit -Hf”可分别显示其fsize,fsize_hard的大小. //如何查看小型机适配器卡及硬盘的微码级别microcode level lscfg -vl device_name //查询SSA卡的微码级别 #...

    入门级的SUN培训资料

    入门级的SUN培训资料 第一部分 SUN基础知识 4 一.SUN发展简史 4 (一)硬件体系 4 (二)软件体系 4 ...7.IOSTAT 监视磁盘状态 31 8.UPTIME 显示系统运行时间以及在过去的15分钟内系统的负载情况 32

Global site tag (gtag.js) - Google Analytics