Linux – How to See What’s Waiting for Disk IO

iolinuxtop

I have a server that has a really high load. Nothing is jumping out at me in terms of CPU usage, and it's not swapping.

I think it's cause some processes are waiting for disk IO, and I want to see what's waiting.

Is there any programme that'll show me what processes are waiting for IO? I know about iotop but that shows what's currently doing IO.

Or is this a silly question? (If so explain how 🙂 )

Best Answer

You can use an I/O monitor like iotop, but it will show you only processes or threads with current I/O operations.

If you need to browse processes waiting for I/O, use watch to monitor processes with STAT flag 'D' like below:

watch -n 1 "(ps aux | awk '\$8 ~ /D/  { print \$0 }')"