Theoretically you can obtain
iowait per process from
/proc/[pid]/stat, since from corresponding block of PROC(5) we read:
(42) delayacct_blkio_ticks %llu (since Linux 2.6.18)
Aggregated block I/O delays, measured in clock ticks (centiseconds).
I have no idea what the
delayacct_blkio_ticks means practically. Anyway, the only
man proc will be useful to you.
There is related question, check it: Measuring block I/O delays using proc FS
Additionally, pay your attention to notes for
/proc/stat in the per CPU
- The CPU will not wait for I/O to complete; iowait is the time that a task is waiting for I/O to complete. When a CPU goes into idle
state for outstanding task I/O, another task will be scheduled on this
- On a multi-core CPU, the task waiting for I/O to complete is not running on any CPU, so the iowait of each CPU is difficult to
- The value in this field may decrease in certain conditions.
You can get
iowait data per CPU from
/proc/stat. On my Ubuntu 18.04 in the
/proc/stat there is such the part:
cpu 2752162 16054 941158 49212025 789607 0 217089 0 0 0
cpu0 1397207 7767 500620 24623046 407078 0 70574 0 0 0
cpu1 1354955 8286 440538 24588978 382529 0 146515 0 0 0
The fifth column besides
cpus column is
iowait value in my particular case. The number of columns and its meaning can be various depending on your kernel in use.
To get every column exact meaning you have to look at your documentation. In Ubuntu install
linux-doc package first:
sudo apt install linux-doc
and look at
There is part with exact
/proc/stat explanation for every column.
Read additionally How to read the Linux /proc/stat file to know how to calculate values.
In CentOS it's necessary to install
yum install kernel-doc
then read the file: