Linux iotop工具简介 - Go语言中文社区

Linux iotop工具简介


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随时切换

-b

--batch

非交互模式下运行,一般用来记录日志。

-n NUM

--iter=NUM

设置监控(显示)NUM次,主要用于非交互模式。默认无限

-d SEC

--delay=SEC

设置显示的间隔秒数,支持非整数

-p PID

--pid=PID

只显示指定进程(PID)的信息

-u USER

--user=USER

版权声明:本文来源博客园,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://www.cnblogs.com/kerrycode/p/11344506.html
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。

  • 发表于 2019-11-09 11:06:08
  • 阅读 ( 1051 )
  • 分类:Linux

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢