dstat command w/ examples in linux

it dstat The command guide follows my previous 90 Linux Commands Frequently Used by Linux Sysadmins article. Over time, I will continue to publish articles on about 90 commands geared towards Linux sysadmins and Linux power users. let’s continue this series dstat Permission.

Dstat is used to generate system resource statistics. It is a versatile replacement for vmstat, iostat, netstat And ifstat And overcomes some of the limitations of those tools. In addition, it adds some extra features, more counters, and flexibility. Dstat is suitable for system monitoring during performance tuning, benchmarking and troubleshooting.

Dstat allows overview of system resources in real time. For example, you can compare disk usage with interrupts or compare network bandwidth numbers directly with storage I/O.

Dstat gives detailed selective information in columns and indicates magnitudes and units. Less confusion, less mistakes. Most notably, it makes it easy to build plugins to collect your counters. By default the output of Dstat is designed to be interpreted by humans in real time; However, you can export the details in CSV output to a file to be imported into Gnumeric or Excel later to generate graphs.

To use dstat to associate the network-usage (eth0), total CPU-usage, and disk-throughput with the system counter, use:

To use the time plugin with the cpu, net, disk, system, load, proc and top_cpu plugins, use: (see screenshot above)

dstat option

-c, -cpu
Enable CPU statistics (system, user, idle, wait), see also for more CPU related statistics -cpu-advice And -cpu-usage

-c 0,3, total
include cpu0, cpu3 and total (when using -c/–cpu); Use All to show all CPUs

-d, -disk
Enable disk statistics (read, write), look in the second for more disk related statistics -Disc plug-in

-d total, hda
include total and hda (when using -d/–disk)

-g, -page
Enable page statistics (page in, page out)

-i, -int
enable interrupt statistics

-i 5,10
Include interrupts 5 and 10 (when using -i/–int)

-l, -load
Enable load average statistics (1 min, 5 min, 15 min)

-m, -mem
Enable memory statistics (used, buffers, cache, free); Also try for more memory-related statistics -meme-advice And -change

-n, -net
Enable network statistics (receive, send)

-n eth1, total
include eth1 and total (when using -n/–net)

-p, -proc
Enable process statistics (runnable, uninterruptible, new)

-r, -i
Enable I/O request statistics (read requests, write requests)

-s, -swap
Enable swap statistics (used, free)

-s swap1, total
include swap1 and total (when using -s/-swap)

-t, -time
Enable time/date output

-t, -epoch
Enable time counter (seconds since epoch)

-y, -sys
Enable system statistics (interruptions, context switches)

Enable aio statistics (asynchronous I/O)

enable advanced cpu statistics

Enable only CPU usage statistics

-fs, -filesystem
Enable filesystem statistics (open files, inodes)

Enable IPC statistics (message queues, semaphores, shared memory)

Enable file lock statistics (posix, flock, read, write)

enable advanced memory statistics

Enable raw statistics (raw sockets)

Enable socket statistics (total, tcp, udp, raw, ip-fragments)

Enable TCP statistics (listen, installed, sync, time_wait, stop)

enable udp statistics (listen, active)

Enable Unix statistics (datagram, stream, listen, active)

Enable vm statistics (hard pagefaults, soft pagefaults, allocated, free)

Enable advance VM statistics (steal, scnc, scand, pogoru, astl)

Enable ZoneInfo statistics (d32F, d32H, normF, normH)

Enable (external) plugins by plugin name, see plugins for options

List internal and external plugin names

-a, -all
equals -cdngy (default)

-f, -complete
-c, -d, -i, -n and -s expand discovery lists

-v, -vmstat
equal -pmgdsc -D total

Force bits to values ​​expressed in bytes

Force float value on-screen (mutually exclusive with -Integer,

On-screen force integer value (mutually exclusive with -float,

-bw, -blackonwhite
Change color for white background terminal

disable color

disable repeating headers

-no update
Disable intermediate updates when delays > 1

-output file
Write CSV output to file

Show profiling statistics on exit from dstat

While one can create additional dstat plugins, dstat ships with several default plugins. This:

Battery in percent (needs ACPI)

Battery saved in hours, minutes (requires ACPI)

CPU frequency in percent (needs acpi)


number of dbus connections (python-dbus is needed)

Average queue length of requests issued to the device

Average size of requests issued to the device (in sectors)

Average service time (in milliseconds) for I/O requests issued to the device

Number of transfers per second issued to the device

-disk usage
Percentage of CPU time during which I/O requests were issued to the device (bandwidth usage for the device)

Average time (in milliseconds) for I/O requests to be issued to the device

dstat show cputime consumption and latency

dstat show elevated CPU usage

dstat show context switch

dstat show advanced memory usage

fan speed (needs acpi)

– empty space
Disk usage per file system

GPFS read/write I/O (requires mmpmon)

GPFS file system operation (needs mmpmon)

-hello world
hello world example dstat plugin

show innocent buffer stats

show innodb I/O statistics

Show InnoDB Operations Counter

Show brightness I/O throughput

Show software raid (MD) progress and speed

Show number of hits and misses from Memcache

Show MySQL I/O Statistics

Show MySQL keys statistics

Show the number of packets received and transmitted

Show NFS v3 client operations

Show Extended NFS v3 Client Operations

Show NFS v3 Server Operations

Show Extended NFS v3 Server Operations

Show Extended NFS v4 Server Operations

Show NFS v4 stats

show ntp time from ntp server

Show postfix queue size (requires postfix)

show power usage

Show total number of processes

Show qmail queue size (needs qmail)

– say it again
show redis statistics

Show RPC client call statistics

Show RPC server call statistics

-send mail
Show sendmail queue size (needs to be sent)


Show CPU stats using SNMP from DSTAT_SNMPSERVER

Show load statistics using SNMP from DSTAT_SNMPSERVER

Show memory statistics using SNMP from DSTAT_SNMPSERVER

Show network statistics using SNMP from DSTAT_SNMPSERVER

Show network errors using SNMP from DSTAT_SNMPSERVER

Show system statistics (interruptions and context switches) using SNMP from DSTAT_SNMPSERVER

– Snooze
Show number of ticks per second

show squid usage statistics

show test plugin output

system temperature sensor

Show most expensive block I/O process

Show the most expensive block I/O process (including PID and other statistics)

Show the process waiting the most for the child

Show most expensive CPU process


Show the most expensive CPU process (including PID and other statistics)

Show processes using the most CPU time (in ms)

Show process with highest average timescale (in ms)

show most frequent interruptions

Show most expensive I/O process

Show the most expensive I/O process (including PID and other statistics)

Show process with highest total latency (in ms)

Show process with highest average latency (in ms)

Show process using the most memory

Show process which will be killed by OOM first

Show number of utmp connections (requires python-utmp)

Show VMware CPU stats from hypervisor

Show VMware Memory Stats from Hypervisor

Show advanced VMware memory statistics from hypervisor

Show VMware ESX kernel vmhba statistics

Show VMware ESX kernel interrupt statistics

Show VMware ESX kernel port statistics

Show CPU usage per OpenVZ guest

Show I/O usage per OpenVZ guest

Show OpenVZ User BeanCounter

Wireless link quality and signal to noise ratio

Show ZFS arc stats

show zfs l2arc statistics

show zfs zil statistics

aio, cpu, cpu24, cpu-adv, cpu-use, disk, disk24, disk24-old, epoch, fs, int, int24, io, ipc, load, lock, mem, mem-adv, net, page, page24, proc, raw, socket, swap, swap-old, sys, tcp, time, udp, unix, vm, vm-add, zone

Leave a Comment