Dstat System Resource Statistics

Over the past two weeks, we have covered a few ways to monitor your Linux dedicated server, from the CPU usage of processes to website bandwidth. In order to get a true understanding of how your server is using or misusing resources, however, you need to use multiple monitoring tools, namely: vmstat, iostat, netstat, and ifstat.

Dstat is a convenient tool that combines those four and others into one powerful system resource monitor. Among the features available in Dstat are:

  • Display all stats in the same timeframe
  • Modular design
  • Written in python (extendible and cross-platform)
  • Ability to create and share custom counters using external plugins
  • Summarize devices and give number totals
  • Color coded units
  • Ability to export to CSV for importing into spreadsheets

The following are just a few of the devices and services Dstat can monitor:
CPU, swap, io, mem, mysql, postfix, squid, proc, qmail, dbus, cpufreq, tcp, udp, sys, and more.

Sample output of the dstat command looks like this:

----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read writ| recv send| in out | int csw
5 0 93 0 0 0| 154k 84k| 0 0 | 0 0 |1081 1116
13 0 87 0 0 0| 0 0 | 0 0 | 0 0 |1036 696
8 0 92 0 1 0| 0 8192B| 0 0 | 0 0 |1073 936
0 0 99 0 0 1| 0 0 | 0 0 | 0 0 |1072 940
1 1 97 0 2 0| 0 0 | 0 0 | 0 0 |1252 1727
1 1 98 0 1 0| 0 0 | 0 0 | 0 0 |1126 1191
1 0 99 0 0 0| 0 0 | 0 0 | 0 0 |1045 908
0 0 99 0 0 0| 0 44k| 0 0 | 0 0 |1051 904
1 1 99 0 0 0| 0 0 | 0 0 | 0 0 |1036 850
1 0 100 0 0 0| 0 0 | 0 0 | 0 0 |1029 757

Dstat is very useful for performance tests, benchmarking, and troubleshooting. It is free and open source software, released under the GNU GPL, and there are packages available for numerous Linux distributions. More information is available on the project’s website.











Comments: