iotop 磁碟io異常時的檢視工具

2021-09-27 12:57:17 字數 1669 閱讀 3460

安裝:yum install iotop -y

執行命令:iotop

[root@shvpuppet01 ~]# iotop 

no module named iotop.ui

to run an uninstalled copy of iotop,

launch iotop.py in the top directory

上面報錯解決方法:

sed -i 's#/usr/bin/python#/usr/bin/python2.6#' `which iotop`
正常用時的輸出:

total disk read: 0.00 b/s | total disk write: 0.00 b/s

tid prio user disk read disk write swapin io command

1 be/4 root 0.00 b/s 0.00 b/s 0.00 % 0.00 % init

2 be/4 root 0.00 b/s 0.00 b/s 0.00 % 0.00 % [kthreadd]

3 rt/4 root 0.00 b/s 0.00 b/s 0.00 % 0.00 % [migration/0]

4 be/4 root 0.00 b/s 0.00 b/s 0.00 % 0.00 % [ksoftirqd/0]

5 rt/4 root 0.00 b/s 0.00 b/s 0.00 % 0.00 % [migration/0]

6 rt/4 root 0.00 b/s 0.00 b/s 0.00 % 0.00 % [watchdog/0]

7 rt/4 root 0.00 b/s 0.00 b/s 0.00 % 0.00 % [migration/1]

常用引數:

-n:顯示輸出次數

-o:只顯示有io輸出的程序

-b:阻止動態顯示

最常用使用的組合:

iotop -bon2
io異常時的輸出:

[root@shvpuppet01 ~]# iotop -bon2

total disk read: 0.00 b/s | total disk write: 75.73 m/s

tid prio user disk read disk write swapin io command

20340 be/4 root 0.00 b/s 83.85 m/s 0.00 % 38.97 % dd if=/dev/zero of=./test.log bs=4m count=1024

1474 be/4 root 0.00 b/s 259.78 k/s 0.00 % 0.00 % [flush-8:0]

453 be/3 root 0.00 b/s 5.41 g/s 0.00 % 0.00 % [jbd2/sda3-8]

可以很直觀的看到是dd程序占用大量的磁碟io~

檢視磁碟I O操作資訊

set statistics io on 命令是乙個 使 sql server 顯示有關由 transact sql 語句生成的磁碟活動量的資訊。我們在分析索引效能的時候,會非常有用。啟用了這個屬性後,我們在執行 sql 語句後,會收到類似如下的資訊,這有利於我們分析sql的效能 3999 row ...

利用iotop檢視到底是哪個程序耗io

iotop op h,help 顯示幫助然後退出 o,only 只顯示正在產生i o的程序或執行緒。除了傳參,可以在執行過程中按o生效。b,batch 非互動模式,一般用來記錄日誌 n num,iter num 設定監測的次數,預設無限。在非互動模式下很有用 d sec,delay sec 設定每次...

linux檢視磁碟io的幾種方法

怎樣才能快速的定位到併發高是由於磁碟io開銷大呢?可以通過三種方式 第一種 用 top 命令 中的cpu 資訊觀察 top可以看到的cpu資訊有 tasks 29 total,1 running,28 sleeping,0 stopped,0 zombie cpu s 0.3 us,1.0 sy,0...