linux – 显示自上次在CentOS上启动以来磁盘的I / O数(读/写)

是否有可能使用iostat(或其他工具)来获取“自上次服务器重启以来”的读/写操作次数

我的意思是:我需要知道自上次启动以来服务器完成了多少次读/写,而不是实时.

谢谢!

解决方法

有关数据量,请参阅iostat:
[root@example ~]# iostat -m
Linux 2.6.32-431.11.2.el6.x86_64 (example.com)  08/08/2014  _x86_64_    (2 cpu)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.38    0.00    4.10    0.36    0.10   95.07

Device:            tps    MB_read/s    MB_wrtn/s    MB_read    MB_wrtn
sda               0.95         0.01         0.01      68451      77290
vda              13.95         0.26         0.33    2871276    3572093
dm-0              1.93         0.01         0.01      64657      73426
dm-1             14.39         0.26         0.33    2871274    3572093

-m将以MiB(而不是块)显示输出,MB_read,MB_wrtn是您要查找的数字.

有关I / O操作(请求)的总量,请参阅/ sys / block / $DEV / $PART / stat,例如: / sys / block / sda / sda1 / stat或/ proc / diskstats,可以解释如下(这是从kernel doc tree开始):

What:       /proc/diskstats
Date:       February 2008
Contact:    Jerome marchand <jmarchan@redhat.com>
Description:
        The /proc/diskstats file displays the I/O statistics
        of block devices. Each line contains the following 14
        fields:
         1 - major number
         2 - minor mumber
         3 - device name
         4 - reads completed successfully
         5 - reads merged
         6 - sectors read
         7 - time spent reading (ms)
         8 - writes completed
         9 - writes merged
        10 - sectors written
        11 - time spent writing (ms)
        12 - I/Os currently in progress
        13 - time spent doing I/Os (ms)
        14 - weighted time spent doing I/Os (ms)
        For more details refer to Documentation/iostats.txt

相关文章

在Linux上编写运行C语言程序,经常会遇到程序崩溃、卡死等异...
git使用小结很多人可能和我一样,起初对git是一无所知的。我...
1. 操作系统环境、安装包准备 宿主机:Max OSX 10.10.5 虚拟...
因为业务系统需求,需要对web服务作nginx代理,在不断的尝试...
Linux模块机制浅析 Linux允许用户通过插入模块,实现干预内核...
一、Hadoop HA的Web页面访问 Hadoop开启HA后,会同时存在两个...