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)

-AIO
Enable aio statistics (asynchronous I/O)

-cpu-advice
enable advanced cpu statistics

-cpu-usage
Enable only CPU usage statistics

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

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

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

-meme-advice
enable advanced memory statistics

-raw
Enable raw statistics (raw sockets)

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

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

-Udpi
enable udp statistics (listen, active)

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

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

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

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

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

-List
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

-bits
Force bits to values ​​expressed in bytes

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

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

-bw, -blackonwhite
Change color for white background terminal

colorless
disable color

-noheaders
disable repeating headers

-no update
Disable intermediate updates when delays > 1

-output file
Write CSV output to file

-profile
Show profiling statistics on exit from dstat

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

-battery
Battery in percent (needs ACPI)

-battery-residue
Battery saved in hours, minutes (requires ACPI)

-cpufreq
CPU frequency in percent (needs acpi)

-dubs

number of dbus connections (python-dbus is needed)

–disk-average
Average queue length of requests issued to the device

–disk-average
Average size of requests issued to the device (in sectors)

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

-disk-tps
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)

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

-dstat
dstat show cputime consumption and latency

-dstat-cpu
dstat show elevated CPU usage

-dstat-ctxt
dstat show context switch

–dstat-mem
dstat show advanced memory usage

-fan
fan speed (needs acpi)

– empty space
Disk usage per file system

-gpfs
GPFS read/write I/O (requires mmpmon)

-gpfs-ops
GPFS file system operation (needs mmpmon)

-hello world
hello world example dstat plugin

-inodb-buffers
show innocent buffer stats

-inodb-io
show innodb I/O statistics

-innodb-ops
Show InnoDB Operations Counter

-lustre
Show brightness I/O throughput

-md-status
Show software raid (MD) progress and speed

-memcache-hits
Show number of hits and misses from Memcache

-mysql-io
Show MySQL I/O Statistics

-mysql-keys
Show MySQL keys statistics

-net-packet
Show the number of packets received and transmitted

-nfs3
Show NFS v3 client operations

-nfs3-ops
Show Extended NFS v3 Client Operations

-nfsd3
Show NFS v3 Server Operations

-nfsd3-ops
Show Extended NFS v3 Server Operations

-nfsd4-ops
Show Extended NFS v4 Server Operations

-nfsstat4
Show NFS v4 stats

-ntp
show ntp time from ntp server

-postfix
Show postfix queue size (requires postfix)

-Power
show power usage

-proc-count
Show total number of processes

-qmail
Show qmail queue size (needs qmail)

– say it again
show redis statistics

-RPC
Show RPC client call statistics

-RPCD
Show RPC server call statistics

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

-snmp-cpu

Show CPU stats using SNMP from DSTAT_SNMPSERVER

-snap-load
Show load statistics using SNMP from DSTAT_SNMPSERVER

-snap-mem
Show memory statistics using SNMP from DSTAT_SNMPSERVER

-snmp-net
Show network statistics using SNMP from DSTAT_SNMPSERVER

-snmp-net-error
Show network errors using SNMP from DSTAT_SNMPSERVER

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

– Snooze
Show number of ticks per second

-squid
show squid usage statistics

-testing
show test plugin output

-thermal
system temperature sensor

-top-bio
Show most expensive block I/O process

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

-top-childweight
Show the process waiting the most for the child

-top-cpu
Show most expensive CPU process

–top-cpu-advice

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

–top-cputime
Show processes using the most CPU time (in ms)

–top-cputime-average
Show process with highest average timescale (in ms)

-top-int
show most frequent interruptions

-top-me
Show most expensive I/O process

-top-io-advice
Show the most expensive I/O process (including PID and other statistics)

-vertex-latency
Show process with highest total latency (in ms)

-vertex-latency-average
Show process with highest average latency (in ms)

-top-mem
Show process using the most memory

-up-uncle
Show process which will be killed by OOM first

-utmp
Show number of utmp connections (requires python-utmp)

-vm-cpu
Show VMware CPU stats from hypervisor

-vm-mem
Show VMware Memory Stats from Hypervisor

-vm-mem-adv
Show advanced VMware memory statistics from hypervisor

-vmk-hba
Show VMware ESX kernel vmhba statistics

-vmk-int
Show VMware ESX kernel interrupt statistics

-vmk-nothing
Show VMware ESX kernel port statistics

-vz-cpu
Show CPU usage per OpenVZ guest

-vz-i
Show I/O usage per OpenVZ guest

-vz-ubc
Show OpenVZ User BeanCounter

-Wi-Fi
Wireless link quality and signal to noise ratio

-zfs-arc
Show ZFS arc stats

-zfs-l2arc
show zfs l2arc statistics

-zfs-zil
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