Table of Contents

dstat - How to use dstat command in Linux



dstat command options

# dstat -h
  -t, --time             enable time/date output
  -a, --all              equals -cdngy (default)
  -f, --full             automatically expand -C, -D, -I, -N and -S lists

Example

# dstat
You did not select any stats, using -cdngy by default.
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw 
  1   0  99   1   0   0| 244k  121k|   0     0 |   0     0 | 106   227 
  1   0  99   0   0   0|   0  4096B|  60B  114B|   0     0 |  97   186 
  0   0 100   0   0   0|   0  4096B|  60B  106B|   0     0 |  95   196 
  0   1  98   1   0   0|   0   970k|  60B   98B|   0     0 | 130   283 
  1   0  98   1   0   0|   0  4096B|  60B  114B|   0     0 | 100   206 
  0   0 100   0   0   0|   0  4096B|  60B   98B|   0     0 |  84   174 
  0   0 100   0   0   0|   0  4096B|  60B   98B|   0     0 |  81   154 
  0   0 100   0   0   0|   0     0 |  60B   98B|   0     0 |  66   140 
  1   0  99   0   0   0|   0     0 |  60B   98B|   0     0 |  78   152 
  0   0 100   0   0   0|   0     0 |  60B   98B|   0     0 |  70   147 
  0   0  99   1   0   0|   0  4096B|  60B   98B|   0     0 |  76   156 
# dstat -taf
----system---- -------cpu0-usage------ --dsk/sda-- -net/enp0s3 ---paging-- ---system--
     time     |usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw 
11-04 23:41:43|  1   0  99   0   0   0| 221k  116k|   0     0 |   0     0 | 104   222 
11-04 23:41:44|  0   0 100   0   0   0|   0  4096B| 120B  170B|   0     0 |  89   162 
11-04 23:41:45|  1   0  99   0   0   0|   0  4096B|  60B  106B|   0     0 |  70   159 
11-04 23:41:46|  0   0  99   1   0   0|   0   650k|  60B   98B|   0     0 |  90   184 
11-04 23:41:47|  0   0 100   0   0   0|   0     0 |  60B  106B|   0     0 |  94   175 
11-04 23:41:48|  1   0  98   1   0   0|   0  4096B| 120B  166B|   0     0 | 102   240 
11-04 23:41:49|  0   1  99   0   0   0|   0  4096B|  60B  106B|   0     0 |  73   154 

Memory

# dstat -t -gs --mem --vm --ipc
----system---- ---paging-- ----swap--- ------memory-usage----- -----virtual-memory---- --sysv-ipc-
     time     |  in   out | used  free| used  buff  cach  free|majpf minpf alloc  free|msg sem shm
08-07 22:49:40|   0     0 |   0   820M| 275M 4180k  231M  231M|   4  2007  1318  1492 |  0   2   8
08-07 22:49:41|   0     0 |   0   820M| 275M 4180k  231M  231M|   0     4     4     5 |  0   2   8
08-07 22:49:42|   0     0 |   0   820M| 275M 4180k  231M  231M|   0    15    95    93 |  0   2   8
08-07 22:49:43|   0     0 |   0   820M| 275M 4180k  231M  231M|   0     1     2     2 |  0   2   8

Disk

# dstat -tdng --file --lock --top-io --top-bio
----system---- -dsk/total- -net/total- ---paging-- --filesystem- ---file-locks-- ----most-expensive---- ----most-expensive----
     time     | read  writ| recv  send|  in   out |files  inodes|pos lck rea wri|     i/o process      |  block i/o process
08-07 22:50:29| 649k   86k|   0     0 |   0     0 | 1568  15455 | 42 4.0   0  46|systemd      45k  109k|mysqld      159k   62k
08-07 22:50:30|   0  4096B| 720B 1788B|   0     0 | 1568  15605 | 42 4.0   0  46|snmpd      4412B    0 |mysqld        0  4096B
08-07 22:50:31|   0  4096B|  60B  518B|   0     0 | 1568  15605 | 42 4.0   0  46|mysqld      732B 3067B|mysqld        0  4096B
08-07 22:50:32|   0     0 | 152B  654B|   0     0 | 1568  15605 | 42 4.0   0  46|mysqld      654B 1152B|
08-07 22:50:33|   0  4096B|  60B  502B|   0     0 | 1568  15605 | 42 4.0   0  46|zabbix_agen1142B    0 |mysqld        0  4096B
08-07 22:50:34|   0  4096B| 120B  578B|   0     0 | 1568  15605 | 42 4.0   0  46|mysqld      793B 2527B|mysqld        0  4096B