5 TOOLS FOR MONITORING DISK ACTIVITY IN LINUX

Here is a quick overview of 5 command-line tools that come in incredibly handy when troubleshooting or monitoring real-time disk activity in Linux. These tools are available in all major Linux distros.

IOSTAT

iostat can be used to report the disk read/write rates and counts for an interval continuously. It collects disk statistics, waits for the given amount of time, collects them again and displays the difference. Here is the output of the command iostat -y 5:

iostat in action

Each report, every 5 seconds, include the CPU stats and the disk stats. The CPU stats is a break up of where CPU time was spent during the interval. The disk stats includes the number of I/O requests per second (tps), the rate of read and write (kB_read/s and kB_write/s) and the amount of data read and written (kB_read and kB_wrtn).

The -y argument instructs iostat to discard the first report which are the stats since boot and are rarely useful. The “5” in the command line specifies the interval in seconds. The CPU stats can be omitted by including the -dflag, although practically it is useful to have it there.

IOTOP

iotop is a top-like utility for displaying real-time disk activity. It can list the processes that are performing I/O, alongwith the disk bandwidth they are using. Here is how iotop -o looks like:

iotop in action

The -o flag restricts the display to processes that are doing I/O, omitting it shows all the processes. You can also see the total disk bandwidth usage on the top two lines.

In case you are wondering, the “total” values show the amount of data read from or written to the disk block device driver, and the “actual” values show the numbers for the actual hardware disk I/O. File system caching is one of the reasons for the difference in the values.

DSTAT

dstat is a little more user-friendly version of iostat, and can show much more information than just disk bandwidth. Here is dstat in action, showing cpu and disk stats:

dstat in action

As you can see, it has nicely colored output. The command-line flags include -c for CPU stats, -d for disk stats, --disk-util for disk utilization and --disk-tps for disk transactions (I/O requests) per second. You can read more about dstat here.

ATOP

atop is particularly good for quickly grasping changes happening to the system. It does an excellent job of summarizing changes in each interval. Unlike the others, it can list all the processes that caused any system-level changes (like doing disk I/O) during the interval – this feature is present only in atop.

atop in action

Here we’re running atop with an interval of 1 second. The top section should be read from left to right: PRC shows process information, CPU the split of CPU usage, CPL the load averages, MEM the memory usage, SWP the swap file usage and DSK and NET the disk and network information respectively. The bottom section shows processes that did interesting things during the interval. You can read more about atop here.

IOPING

ioping is a quick and dirty storage volume latency checker. It is useful for checking if the elevated disk times that you’re seeing are because of a degradation of the underlying virtual disk / network / hardware.

ioping in action

Low numbers (<1ms) and low variance in the numbers are indicators of a healthy storage volume.

CLOSING NOTES

All the tools listed above have more features and options, here are good places to start digging further: iostat,iotopdstatatop and ioping.

If you’re interested in measuring disk performance, you should definitely also look at fio and sysbench. Both are fairly complicated, but are standard tools for the job.

Linux 磁盘使用查看 查看使用磁盘程序 Monitoring disk activity in linux的更多相关文章

  1. linux 磁盘挂载及查看磁盘

    blkid命令实例 .列出当前系统中所有已挂载文件系统的类型: sudo blkid .显示指定设备 UUID: sudo blkid -s UUID /dev/sda5 .显示所有设备 UUID: ...

  2. Linux Centos下查看cpu、磁盘、内存使用情况,关闭MySQL日志

    Linux Centos下查看cpu.磁盘.内存使用情况,关闭MySQL日志 lsblk 查看分区和磁盘df -h 查看空间使用情况fdisk -l 分区工具查看分区信息cfdisk /dev/sda ...

  3. Linux命令_磁盘管理_查看磁盘或目录的容量

    软件环境:虚拟机VM12,Linux版本 CentOS 7.3 命令 df (disk filesystem) 用于查看已挂载磁盘的总容量.使用容量.剩余容量等,可以不加任何参数,默认以KB为单位显示 ...

  4. 【linux】linux磁盘空间 目录查看清理 和 文件查看清理

    =========================大目录排查============================= 一.首先查看磁盘挂载,磁盘空间使用情况 1.进入根路径 cd / 2.查看磁盘挂 ...

  5. [转帖]linux下使用 du查看某个文件或目录占用磁盘空间的大小

    linux下使用 du查看某个文件或目录占用磁盘空间的大小 du -ah --max-depth= 去年用过一次 后来忘记了.. 命令这个东西 熟能生巧.. https://www.cnblogs.c ...

  6. 未加星标 Linux磁盘下查看I/O磁盘的性能

    iostat查看linux硬盘IO性能 rrqm/s:每秒进行merge的读操作数目.即delta(rmerge)/s wrqm/s:每秒进行merge的写操作数目.即delta(wmerge)/s ...

  7. 磁盘io负载查看

    转自:http://blog.csdn.net/i_am_jojo/article/details/7698458 为了方便各位和自己今后遇到此类问题能尽快解决,我这里将查看linux服务器硬盘IO访 ...

  8. mysql数据库查看各实例磁盘占用情况

    1.总体查看: use information_schema; select TABLE_SCHEMA, concat(truncate(sum(data_length)/1024/1024,2),' ...

  9. 脚本_查看所有虚拟机磁盘以及 CPU 的使用量

    #!bin/bash#作者:liusingbon#功能:查看所有虚拟机磁盘使用量以及 CPU 使用量信息read -p "按任意键进入查看页面.比如按下Enter键" keyvir ...

随机推荐

  1. 【安全狗SRC】抗D设备哪家强?你来!大佬告诉你答案

    上周,安全狗SRC联合SRC部落,携手推出了爆款话题:传统抗D设备 vs 新兴CDN抗D:抗D效果哪个好? 一经发布简直好评如潮,热评无数,四方雷动(?)原帖在此,错过的吃瓜表哥们可以再围观一下~ht ...

  2. MyEclipse + Maven开发Web工程的详细配置过程

    好久没做Web方面的开发,今天突然想弄弄SpringMVC,因为不久前又学了点Maven觉得非常好,所以在弄SpringMVC这个Web框架时想使用Maven来做,但是问题又来了,我一直是在Eclip ...

  3. itext实现合同尾部签章部分自动添加,定位签名

    使用的pom <!-- pdf处理 start--> <dependency> <groupId>com.itextpdf</groupId> < ...

  4. django rest framework serializers解读

    serializers是什么?官网是这样的"Serializers allow complex data such as querysets and model instances to b ...

  5. shell中mail发邮件的问题

    今天为了监控一下脚本,按照网上说的利用mail 发邮件,mail -s "error预警2" peien@1221.qq.com<'邮件内容',发现出现cc,不知道啥问题,也 ...

  6. Zabbix系列之六——添加web监测

    zabbix提供了web监测功能,监控到站点的响应时间,还可以根据站点返回的状态码,或者响应时间做报警,列入服务保证官网确打不开等现象. 官网地址:https://www.zabbix.com/doc ...

  7. php 对数组按照字符串长度排序

    $file = file('zong.txt'); usort($file, 'sortByLen'); $handle = fopen('zong2.txt', 'a'); foreach ($fi ...

  8. vmware workstation 提示程序包可能有错,错误代码 29141 & 提示不可恢复错误: (vcpu-0)

    问题一:提示程序包可能有错,错误代码 29141 换了n个版本(vmware workstation 10,11, 12),下载了n次,都提示该错误(29141),明明程序包没错啊, 一开始还怀疑是我 ...

  9. Java并发编程笔记之ConcurrentLinkedQueue源码探究

    JDK 中基于链表的非阻塞无界队列 ConcurrentLinkedQueue 原理剖析,ConcurrentLinkedQueue 内部是如何使用 CAS 非阻塞算法来保证多线程下入队出队操作的线程 ...

  10. #3 Python解释器和编辑器

    前言 上文介绍了Python在不同平台的安装方法,本文将带领你了解Python解释器和编辑器的概念,并且选择出最符合自己的解释器和编辑器! 一.Python解释器 其实上文介绍的安装Python,实质 ...