Help Docs Server Administration Linux Server Administration Dstat

Dstat

Dstat: Real-time system monitor for CPU, mem, disk, net. Extends vmstat/iostat. Customizable stats, plugins, CSV output. Install & use.

Dstat: Installation & usage guide

What is Dstat?

Dstat is a versatile real-time resource monitoring tool that combines and extends tools like vmstat, iostat, and ifstat. It provides detailed, customizable output on system resources such as CPU, memory, disk, network, interrupts, and more. Output can be written to a CSV file for graphing and analysis.

Installation

CentOS:

yum install dstat

Ubuntu:

sudo apt-get install dstat

Common options

OptionDescription
-c, --cpuCPU usage (user, system, idle, etc.)
-C 0,3,totalSpecific CPUs
-d, --diskDisk read/write stats
-D total,hdaSpecific disks
-g, --pagePage in/out
-i, --intInterrupts
-I 5,10Specific interrupts
-l, --loadLoad average (1, 5, 15 mins)
-m, --memMemory usage
-n, --netNetwork usage
-N eth1,totalSpecific interfaces
-p, --procProcess stats
-r, --ioI/O requests
-s, --swapSwap usage
-S swap1,totalSpecific swap devices
-t, --timeShow time/date
-T, --epochShow epoch timestamp
-y, --sysSystem stats

Other useful flags:

  • --output file.csv — Write output to CSV
  • --list — List all available plugins
  • -a — Equivalent to -cdngy
  • -f — Expands device/interface listings
  • --float / --integer — Force output type
  • --nocolor, --noheaders, --noupdate — Format control

Plugins (Sample)

Dstat supports a wide range of optional plugins, including:

  • --top-cpu, --top-io, --top-mem — Top resource consumers
  • --thermal, --fan, --battery — ACPI sensors
  • --mysql5-*, --innodb-* — MySQL performance
  • --net-packets, --disk-util — Extended network/disk metrics
  • --wifi, --vmk-*, --vz-* — Virtualization stats

Use --list to view all available plugins.

Arguments

  • delay – Interval between updates (default: 1 second)
  • count – Number of updates before exit (default: unlimited)

If delay > 1, dstat shows intermediate averages unless --noupdate is set.

Example commands

  • Monitor disk, network, and CPU stats:
dstat -dnyc -N eth0 -C total -f 5
  • View system impact with debug:
dstat -taf --debug

  • Full system overview with top CPU process:
 dstat -tcndylp --top-cpu

Conclusion

Dstat is a versatile command-line tool for real-time system resource monitoring, serving as an enhanced alternative to tools like vmstat, iostat, and ifstat. It allows users to view detailed statistics on CPU, memory, disk I/O, network usage, system interrupts, load averages, and more, all in a customizable and easily readable format. Output can be written to CSV for external analysis or graphing. Installation is simple via yum on CentOS or apt on Ubuntu. Dstat supports a wide range of options and plugins, enabling deep insights into specific system areas, such as MySQL performance, ACPI battery stats, virtual machines, and top resource-consuming processes. Common use cases include correlating disk and network activity, monitoring process behavior, or assessing system load over time with the --time, --cpu, --net, --disk, --sys, and --top-cpu options.

Was this article helpful?