🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

dstat Command

Beginner Performance & Debugging man(1)

Versatile real-time system resource statistics

📅 Updated: Mar 16, 2026
SYNTAX
dstat [OPTIONS] [DELAY [COUNT]]

What Does dstat Do?

The dstat command provides a real-time, color-coded overview of system resources in a single view — combining the functionality of vmstat, iostat, netstat, and ifstat into one tool. It displays CPU usage, disk I/O, network throughput, memory, paging, and system interrupts in a continuously updating table.

dstat is the ideal tool for correlating system metrics during troubleshooting. When a server is slow, dstat shows CPU, disk, network, and memory statistics simultaneously, making it easy to identify which resource is the bottleneck. Each metric updates every second by default, creating a rolling log that is perfect for identifying spikes and patterns.

On newer systems, dstat may be replaced by dool (a dstat clone) or is available as the pcp-system-tools package. The interface and functionality remain the same. dstat also supports plugins for additional metrics like battery status, MySQL queries, process information, and more.

Options & Flags

OptionDescriptionExample
(no options) Show CPU, disk, net, paging, and system stats dstat
-c CPU usage (user, system, idle, wait, hardware/software interrupts) dstat -c
-d Disk read/write rates dstat -d
-n Network send/receive rates dstat -n
-m Memory usage (used, buffers, cache, free) dstat -m
-g Page in/out rates dstat -g
--top-cpu Show process using most CPU dstat --top-cpu
--top-io Show process with highest I/O dstat --top-io
--top-mem Show process using most memory dstat --top-mem
--output FILE Write stats to CSV file dstat --output stats.csv 5 60

Practical Examples

#1 Overall system overview

Show all main stats: CPU, disk, network, paging, and system. Updates every second with color-coded output.
$ dstat

#2 Find the bottleneck

Comprehensive view: CPU, disk, network, memory, plus which process uses most CPU and I/O. The go-to command for troubleshooting.
$ dstat -cdnm --top-cpu --top-io

#3 Disk I/O analysis

Monitor specific disks with 5-second intervals. Identify which disk is the I/O bottleneck.
$ dstat -d -D sda,sdb,nvme0n1 5

#4 Network monitoring

Monitor per-interface network throughput every second. Compare physical and VPN interface traffic.
$ dstat -n -N eth0,wg0 1

#5 Log to CSV file

Record system stats every 60 seconds to a CSV file. Great for long-term performance baselines.
$ dstat -cdnm --output /var/log/dstat-$(date +%Y%m%d).csv 60

#6 Monitor during operation

Monitor all resources every second for 2 minutes. Run in one terminal while performing operations in another.
$ dstat -cdnm 1 120

#7 Find memory hog

Monitor memory usage and show which process is consuming the most RAM, updating every 2 seconds.
$ dstat -m --top-mem 2

Tips & Best Practices

Install dstat: Install with: apt install dstat (Debian/Ubuntu), dnf install dstat or pcp-system-tools (Fedora — dstat is now dool), brew install dstat (macOS).
dstat vs dool: On Fedora 36+ and RHEL 9+, dstat is replaced by dool (a Python 3 rewrite). The command syntax is identical. Install: dnf install dool.
Color-coded output: dstat uses colors: high values appear in different colors to draw attention. This helps quickly identify abnormal readings in the continuous output stream.
CSV for graphing: Use --output file.csv to create data files you can import into spreadsheets or graphing tools for performance reports and trend analysis.

Frequently Asked Questions

What is dstat used for?
dstat provides a real-time, combined view of CPU, disk, network, memory, and system stats. It replaces multiple tools (vmstat, iostat, netstat) with one command for quick bottleneck identification.
What is the difference between dstat and vmstat?
dstat shows more metrics simultaneously (CPU + disk + network + memory), uses color, shows per-device stats, identifies top processes, and can log to CSV. vmstat focuses mainly on memory and CPU.
Is dstat available on RHEL 9 / Fedora?
dstat is replaced by dool on newer Fedora/RHEL. Install with: dnf install dool. The command syntax is identical to dstat.
How do I log system performance over time?
Use: dstat --output perf.csv 60 — records all metrics every 60 seconds to a CSV file. Import into spreadsheets for trend analysis. For enterprise monitoring, consider sar from sysstat.

Master Linux with Professional eBooks

Curated IT eBooks covering Linux, DevOps, Cloud, and more

Browse Books →