The dstat utility can identify the top resource user in a category:
- -top-bio Disk Usage: This reports the process performing the most block I/O
- -top-cpu CPU Usage: This reports the process using the most CPU resources
- -top-io I/O usage: This reports the process performing the most I/O (usually network I/O)
- -top-latency System Load: This shows the process with the highest latency
- -top-mem Memory Usage: This shows the process using the most memory
The following example displays the CPU and Network usage and the top users in each category:
$ dstat -c -top-cpu -n -top-io ----total-cpu-usage---- -most-expensive- -net/total- ----most-expensive---- usr sys idl wai hiq siq| cpu process | recv send| i/o process 1 2 97 0 0 0|vmware-vmx 1.0| 0 0 |bash 26k 2B 2 1 97 0 0 0|vmware-vmx 1.7| 18k 3346B|xterm 235B 1064B 2 2 97 0 0 0|vmware-vmx 1.9| 700B 1015B|firefox 82B 32k
On a system running an active virtual machine, the VM uses the most CPU time, but not the bulk of the IO. The CPU is spending most of its time in the idle state.
The -c and -n options specify showing the CPU usage and Network usage, respectively.