dstat: live system information

$ dstat -a
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw 
 11   3  85   1   0   0|  51k   58k|   0     0 |   0     0 | 172   864 
  1   0  99   0   0   0|   0  4096B|   0     0 |   0     0 |  81   224 
  0   0 100   0   0   0|   0     0 |   0     0 |   0     0 |  57   174 
  1   0  99   0   0   0|   0     0 |  14k  121B|   0     0 | 104   306 
  1   0  99   0   0   0|   0     0 |  97B  121B|   0     0 | 124   596 
  1   0  99   0   0   0|   0     0 | 218B  172B|   0     0 | 106   407 
  0   0 100   0   0   0|   0     0 | 229B  121B|   0     0 |  84   296 
  1   1  99   0   0   0|   0     0 | 785B  723B|   0     0 | 120   344 
  0   0  99   0   0   0|   0     0 | 163B  121B|   0     0 |  67   208 
  0   0 100   0   0   0|   0     0 |  54B   86B|   0     0 |  67   217 
  0   0 100   0   0   0|   0     0 |   0     0 |   0     0 |  52   161 
  0   0 100   0   0   0|   0     0 |   0     0 |   0     0 |  49   163 
  0   0 100   0   0   0|   0     0 |   0     0 |   0     0 |  56   206 
  0   0 100   0   0   0|   0     0 |   0     0 |   0     0 |  88   304 
  1   0  99   0   0   0|   0     0 |   0     0 |   0     0 | 107   461 
  1   0  99   0   0   0|   0     0 |   0     0 |   0     0 |  60   243 
  0   0 100   0   0   0|   0     0 |   0     0 |   0     0 |  50   148 
  0   0 100   0   0   0|   0     0 |   0     0 |   0     0 |  47   128 
  1   0  99   0   0   0|   0     0 |   0     0 |   0     0 |  90   431 
  1   0  99   0   0   0|   0     0 |   0     0 |   0     0 | 100   408

What if you could have the functionality of vmstat, iostat, mpstat, netstat and ifstat in a single tool? dstat is a top like utility to fetch all the information from a running system and show it in the terminal with regular updates. dstat also overcomes some of the limitations of the utilities mentioned above and adds more functionality with new features and counters. You can use it to check performance tuning results, benchmarking or troubleshooting. Unlike sysdig, dstat is a userspace utility written in python.

Features

  • Supports
    > combined and per cpu stats  (system, user, idle, wait, hardware interrupt, software interrupt)
    > disk stats (read, write)
    > page stats (page in, page out)
    > interrupt stats, including per device
    > load average stats (1 min, 5 mins, 15mins)
    > memory stats (used, buffers, cache, free)
    > network stats (receive, send)
    > process stats (runnable, uninterruptible, new)
    > I/O request stats (read, write requests)
    > swap stats (used, free)
    > time/date and time counter (seconds since epoch)
    > system stats (interrupts, context switches)
    > aio stats (asynchronous I/O)
    > filesystem stats (open files, inodes)
    > ipc stats (message queue, semaphores, shared memory)
    > file lock stats (posix, flock, read, write)
    > socket stats (total, tcp, udp, raw, ip-fragments), also raw socket stats
    > tcp, udp, unix stats
    > vm stats (hard pagefaults, soft pagefaults, allocated, free)
  • Compact, clean, coloured view of all supported resources to allow comparison e.g., compare network throughput with disk throughput in an interval. Indicates different units in different colours.
  • Aggregate block device throughput for a certain diskset or networkset e.g. see throughput of all block devices contributing to a filesystem.
  • Shows stats in the same timeframe. Very accurate timeframes, no timeshifts when system is stressed.
  • Enable/order counters as they make most sense during analysis/troubleshooting.
  • Shows exact units and limits conversion mistakes.
  • Show intermediate results when delay > 1.
  • Write your own plugin.
  • Export to CSV output, which can be imported in Gnumeric and Excel to make graphs.
  • Open source and free.

Installation

To install dstat on Ubuntu, run:

$ sudo apt-get install dstat

Usage

To run dstat and see default columns:

$ dstat

For each timeframe, fetch the processes with highest cpu usage, highest block I/O and highest latency:

$ dstat -c --top-cpu -d --top-bio --top-latency

To learn more about the available options, run:

$ man dstat

While you are at the man page, don’t miss the plugins section to realize the true power of dstat.

On GitHub: dstat

Similar software

  • nmon
    $ sudo apt-get install nmon

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s