-1

This question already has an answer here:

I know that the IOWait metric is the amount of time that a cpu is waiting for IO.

As I understand it IOWait always refers to disc io. But why is that? Why doesn't network IO, presumably involving bus communication on the local system and IO for the cpu affect IOWait?

Also, can a process wanting to read from a disc cause IOWait? Or is IO wait always a symptom of a process attempting to write disc?

marked as duplicate by yoonix, ewwhite linux Aug 22 '17 at 22:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4

I know that the IOWait metric is the amount of time that a cpu is waiting for IO.

Almost. IOWait is time the CPU is idle because no task is ready to run and at least one task is not ready to run because it is waiting for I/O.

As I understand it IOWait always refers to disc io. But why is that? Why doesn't network IO, presumably involving bus communication on the local system and IO for the cpu affect IOWait?

It refers to "fast" I/O. That includes disk I/O but not most network I/O. Network I/O does involve some bus communication on the local system but typically involves waiting for things from remote systems. For this reason, it's considered "slow" I/O.

These differences are relfected throughout the system design -- for example, waits for slow I/O are typically interruptible while waits for fast I/O are not. Slow I/O offers asynchronous or non-blocking versions, fast I/O does not.

Also, can a process wanting to read from a disc cause IOWait? Or is IO wait always a symptom of a process attempting to write disc?

It can happen either way. It's most common with reading because it's obvious that the process can't make forward progress until the I/O completes. But that can also happen when writing, for example, if there is insufficient RAM available to buffer the writes.

  • Thank you! Every article I've read on IOWait immediately explains that it is due to disc activity. Your response has resolved the confusion I had surrounding IOwait. – user307927 Aug 22 '17 at 22:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.