The proc(5)
manpage describes iowait as "time waiting for IO to complete". This was mostly explained in an earlier question. My question is: while waiting in blocking IO, does this include waiting on blocking network IO, or only local IO?
The proc(5)
manpage describes iowait as "time waiting for IO to complete". This was mostly explained in an earlier question. My question is: while waiting in blocking IO, does this include waiting on blocking network IO, or only local IO?
It means waiting for "File I/O", that's to say, any read/write call on a file which is in the mounted filesystem, but also probably counts time waiting to swap in or demand-load pages into memory, e.g. libraries not in memory yet, or pages of mmap()'d files which aren't in ram.
It does NOT count time spent waiting for IPC objects such as sockets, pipes, ttys, select(), poll(), sleep(), pause() etc.
Basically it's time that a thread spends waiting for synchronous disc-IO - during this time it is theoretically able to run but can't because some data it needs isn't there yet. Such processes usually show up in "D" state and contribute to the load average of a box.
Confusingly I think this probably includes file IO on network filesystems.
the iowait time is the amount of time a process spends in the kernel I/O scheduler. As far as I know, this doesn't have anything to do with network I/O insofar as regular socket connections go. However, it will include time spent waiting for network file systems like NFS.
It does.
Incidentally, one of the servers that I manage is experiencing high iowait which is caused by a bad NFS mount.
And look at the processes in the
D
state.The iowait includes the network calls. I say this, because NFS is handled as many linux local filesystems from the kernel's point of view:
When processes call a write on file descriptor 5, something like this will happen:
So, the processes doesn't knows what kind of filesystem are using (vfs magic) and the iowait is the same to a local filesystem.