Monitoring Linux/Unix system resource usage with dstat
The commands vmstat, iostat, and netstat are useful for monitoring the resource usage of each hardware component separately. If you want to monitoring all four major resources (CPU, memory, I/O, and network) concurrently, you would need to open multiple windows, one window for each command.
dstat is a versatile tool that you can use to replace all three commands mentioned above. The output from dstat without any option can display the usage pattern of the four major hardware resources in the same report side by side. For example, the following example is the output from running command, dstat 5 while running 8 concurrent backup streams on a 5340 NetBackup Appliance:
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system-- usr sys idl wai hiq siq| read writ| recv send| in out | int csw 13 9 77 0 0 1| 438k 3405M|1767M 3242k| 0 0 | 163k 126k 13 8 77 0 0 1| 362k 3476M|1836M 3157k| 0 0 | 160k 131k 13 8 78 0 0 1| 421k 3391M|1822M 3390k| 0 0 | 154k 127k 13 8 77 0 0 1| 523k 3319M|1666M 2843k| 0 0 | 166k 121k 14 8 77 0 0 1| 587k 3443M|1833M 3399k| 0 0 | 171k 127k 13 8 78 0 0 1| 539k 3483M|1796M 3374k| 0 0 | 149k 117k 12 8 79 0 0 1| 389k 3178M|1692M 3484k| 0 0 | 153k 117k 10 7 83 0 0 1|1256k 2574M|1269M 2707k| 0 0 | 147k 113k 10 7 82 0 0 1| 306k 2571M|1417M 2938k| 0 0 | 137k 115k 10 6 83 0 0 1| 405k 2500M|1226M 3154k| 0 0 | 120k 109k 10 6 83 0 0 1| 397k 2606M|1341M 3073k| 0 0 | 128k 110k
For system monitoring and performance troubleshooting, being able to see all four major resources usage pattern side by side can help speeding up root cause analysis.