AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 619056
Accepted
Dr. Gianluigi Zane Zanettini
Dr. Gianluigi Zane Zanettini
Asked: 2014-08-09 08:45:52 +0800 CST2014-08-09 08:45:52 +0800 CST 2014-08-09 08:45:52 +0800 CST

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

  • 772

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

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

谢谢!

linux
  • 1 1 个回答
  • 5469 Views

1 个回答

  • Voted
  1. Best Answer
    Sven
    2014-08-09T09:08:57+08:002014-08-09T09:08:57+08:00

    数据量见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,可以解释如下(这是来自内核文档树):

    What:       /proc/diskstats
    Date:       February 2008
    Contact:    Jerome Marchand <[email protected]>
    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
    
    • 6

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve