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 :) )
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:
ps axu
and look for processes which are in the "D" state. Based on the ps(1) manpage, processes that are in the D state are in uninterruptable sleep, which almost always means 'waiting for IO'. Unfortunately, killing these processes is usually not possible.Zanchey's answer is the best I know to find out what is waiting for IO.
When you say your server is under high load, what do you mean by that? Something in particular is slow to respond?
If you are wondering if your Disk IO is the bottleneck, I would use the iostat command (part of the sysstat package) to see if the disk actually is under heavy load.
Example:
Enable block_dump logging of what processes are doing block read/write operations:
when done, disable the tracing so you don't spam your log files: