Erlo

Linux iotop工具简介

时间:2019-08-13 12:00   阅读:18次   来源:博客园页面报错

点赞

iotop的简介:

 

iotop是一款开源、免费的用来监控磁盘I/O使用状况的类似top命令的工具,iotop可以监控进程的I/O信息。它是Python语言编写的,与iostat工具比较,iostat是系统级别的IO监控,而iotop是进程级别IO监控。目前最新的版本为iotop 0.6。其官方网址http://guichaz.free.fr/iotop/

 

iotop的安装:

 

注意,iotop的安装有前提条件(如果操作系统不满足这些条件,iotop无法正确安装):

 

  1:内核版本为2.6.20或更高版本

  2Python 2.7或更高的版本

 

官方文档的详细介绍如下:

 

Linux has always been able to show how much I/O was going on (the bi and bo columns of the vmstat 1 command).

Iotop is a Python program with a top like UI used to show of behalf of which process is the I/O going on. It requires Python ≥ 2.7 and a Linux kernel ≥ 2.6.20 with the TASK_DELAY_ACCT CONFIG_TASKSTATS, TASK_IO_ACCOUNTING and CONFIG_VM_EVENT_COUNTERS options on.

 

 

iotopyum安装

 

yum安装是最简单、快捷的。前提条件是你有配置yum的源配置。

 

[root@DB-Server ~]# python -V
Python 2.7.5
[root@DB-Server ~]# uname -a
Linux DB-Server 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@DB-Server ~]# 
 
 
[root@DB-Server ~]# yum -y install iotop

 

 

iotop的源码安装

 

 

wget http://guichaz.free.fr/iotop/files/iotop-0.6.tar.bz2
tar -xvf iotop-0.6.tar.gz 
cd iotop-0.6
python setup.py build
python setup.py install

 

 

iotop的参数

 

 

# iotop --help
Usage: /usr/local/sbin/iotop [OPTIONS]
 
DISK READ and DISK WRITE are the block I/O bandwidth used during the sampling
period. SWAPIN and IO are the percentages of time the thread spent respectively
while swapping in and waiting on I/O more generally. PRIO is the I/O priority at
which the thread is running (set using the ionice command).
 
Controls: left and right arrows to change the sorting column, r to invert the
sorting order, o to toggle the --only option, p to toggle the --processes
option, a to toggle the --accumulated option, i to change I/O priority, q to
quit, any other key to force a refresh.
 
Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -o, --only            only show processes or threads actually doing I/O
  -b, --batch           non-interactive mode
  -n NUM, --iter=NUM    number of iterations before ending [infinite]
  -d SEC, --delay=SEC   delay between iterations [1 second]
  -p PID, --pid=PID     processes/threads to monitor [all]
  -u USER, --user=USER  users to monitor [all]
  -P, --processes       only show processes, not all threads
  -a, --accumulated     show accumulated I/O instead of bandwidth
  -k, --kilobytes       use kilobytes instead of a human friendly unit
  -t, --time            add a timestamp on each line (implies --batch)
  -q, --quiet           suppress some lines of header (implies --batch)

 

 

参数

长参数

参数描述

 

--version

显示版本号

-h

--help

显示帮助信息

-o

--only

只显示正在产生I/O的进程或线程,运行过程中,可以通过按o随时切换

下一篇:神奇的 SQL 之温柔的陷阱 → 三值逻辑 与 NULL...

评论留言

还没有评论留言,赶紧来抢楼吧~~

Erlo大厅()

* 这里是“吐槽厅”,所有人可看,只保留当天信息。

  • Erlo.vip2019-08-19 05:20:36Hello、欢迎使用吐槽厅,这里是个吐槽的地方。
  • 返回顶部