iotop

Published: 08-04-2016

Updated: 10-09-2016

By: Maxime de Roucy

tags: iotop system

Source :

-t
ajoute la colone TIME, implique le mode batch.
-P
affiche uniquement les processus (par défault iotop affiche les processus et les threads). Les éléments afficher entre « [] » sont des threads kernel.
-o
affiche uniquement les threads et/ou processus effectuant des IO.

Voici quelques exemples d’utilisation de ces options.

max@laptop % sudo iotop -t
23:26:48 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:48 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
    TIME  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
23:26:48     1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init
23:26:48     2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
23:26:48     3 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
23:26:48  1028 be/4 max         0.00 B/s    0.00 B/s  0.00 %  0.00 % goa-daemon [gmain]
23:26:48     5 be/0 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/0:0H]
23:26:48  1030 be/4 max         0.00 B/s    0.00 B/s  0.00 %  0.00 % goa-daemon [gdbus]
23:26:48     7 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [rcu_preempt]
…
23:26:50 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:50 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
    TIME  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
23:26:50   940 be/4 max         0.00 B/s    0.00 B/s  0.00 %  3.98 % gnome-shell
23:26:50     1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init
23:26:50     2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
23:26:50     3 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
23:26:50  1028 be/4 max         0.00 B/s    0.00 B/s  0.00 %  0.00 % goa-daemon [gmain]
23:26:50     5 be/0 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/0:0H]
23:26:50  1030 be/4 max         0.00 B/s    0.00 B/s  0.00 %  0.00 % goa-daemon [gdbus]
23:26:50     7 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [rcu_preempt]
…
max@laptop % sudo iotop -t -o
23:26:55 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:55 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
    TIME  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
23:26:56 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:56 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
    TIME  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
23:26:56   940 be/4 max         0.00 B/s    0.00 B/s  0.00 %  3.28 % gnome-shell
23:26:57 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:57 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
    TIME  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
23:26:57   940 be/4 max         0.00 B/s    0.00 B/s  0.00 %  2.17 % gnome-shell
23:26:58 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:58 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
…
max@laptop % sudo iotop -t -P
23:26:22 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:22 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
    TIME  PID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
23:26:22     1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init
23:26:22     2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
23:26:22     3 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
23:26:22   516 be/4 systemd-    0.00 B/s    0.00 B/s  0.00 %  0.00 % systemd-timesyncd
23:26:22     5 be/0 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/0:0H]
23:26:22 14342 be/4 max         0.00 B/s    0.00 B/s  0.00 %  0.00 % gnome-terminal-server
23:26:22     7 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [rcu_preempt]
…
23:26:23 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:23 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
    TIME  PID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
23:26:23   940 be/4 max         0.00 B/s    0.00 B/s  0.00 %  0.54 % gnome-shell
23:26:23     1 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % init
23:26:23     2 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kthreadd]
23:26:23     3 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [ksoftirqd/0]
23:26:23   516 be/4 systemd-    0.00 B/s    0.00 B/s  0.00 %  0.00 % systemd-timesyncd
23:26:23     5 be/0 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [kworker/0:0H]
23:26:23 14342 be/4 max         0.00 B/s    0.00 B/s  0.00 %  0.00 % gnome-terminal-server
23:26:23     7 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.00 % [rcu_preempt]
…
max@laptop % sudo iotop -t -P -o
23:26:26 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:26 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
    TIME  PID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
23:26:27 Total DISK READ :       0.00 B/s | Total DISK WRITE :      22.40 K/s
23:26:27 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
    TIME  PID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
23:26:27   940 be/4 max         0.00 B/s    0.00 B/s  0.00 %  0.44 % gnome-shell
23:26:27   223 be/4 root        0.00 B/s   22.40 K/s  0.00 %  0.00 % systemd-journald
23:26:29 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:29 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
    TIME  PID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
23:26:29   940 be/4 max         0.00 B/s    0.00 B/s  0.00 %  0.31 % gnome-shell
23:26:30 Total DISK READ :       0.00 B/s | Total DISK WRITE :       0.00 B/s
23:26:30 Actual DISK READ:       0.00 B/s | Actual DISK WRITE:       0.00 B/s
…

En mode normal (non batch), il est possible de changé la colone de trie en utilisant simplement les touches/flèches directionnel.

À propos du header et des éléments affichés :

iotop ne fonctionne correctement que si certaines options sont configuré à la compilation du noyau.

max@laptop % zgrep -e CONFIG_TASK_DELAY_ACCT -e CONFIG_TASK_IO_ACCOUNTING -e CONFIG_TASKSTATS -e CONFIG_VM_EVENT_COUNTERS /proc/config.gz
CONFIG_TASKSTATS=y
CONFIG_TASK_DELAY_ACCT=y
CONFIG_TASK_IO_ACCOUNTING=y
CONFIG_VM_EVENT_COUNTERS=y