dstat command

LINUX-Frequently used commands
dstat command Display the contents of a file |
Syntax |
dstat [Option] |
Dstat is a command that can display CPU load by core, IO load by disk, and network transfer rate by interface. Resources that are monitored using top, iostat, and netstat can be monitored with a single command. |
Frequently used options | |
-t | Display the time. |
-c | Displays the percentage of CPU time used. |
-m | Display memory status |
-vm | Displays the status of virtual memory usage. |
-s | Displays the status of the swap usage. |
-g | Displays the number of page inputs and outputs. |
-d | Display the status of the disk |
-r | Number of read/write requests to disk (IOPS) |
-i | Displays the status of interrupt processing. |
-l | Display load average status |
-p | Display the status of the process. |
-y | Display system status |
-lock | Show file lock status.. |
-n | Display network status |
-ipc | Displays the status of interprocess communication. |
-unix | Display the status of UNIX domain sockets |
-tcp | Display the number of bytes in TCP communication |
-udp | Display the number of bytes in UDP communication. |
–float | Include the decimal point in the display. |
–noheaders | Make the header display only once |
Example: Network and disk status. |
# dstat -Tclmdrnt--epoch--- --total-cpu-usage-- ---load-avg--- ------memory-usage----- -dsk/total- --io/total- -net/total- epoch |usr sys idl wai stl| 1m 5m 15m | used free buff cach| read writ| read writ| recv send 1548760630| 2 3 93 3 0|0.92 1.91 2.14|1613M 71.1M 13.4M 180M|1178k 415k|97.8 46.6 | 0 0 1548760631| 2 7 86 5 0|0.92 1.91 2.14|1613M 69.4M 13.7M 182M|2304k 140k| 313 22.0 | 0 0 1548760632| 5 4 90 1 0|0.92 1.91 2.14|1613M 69.3M 13.7M 182M| 20k 64k|5.00 11.0 |2628B 1490 |
Example: Show CPU and memory related |
# dstat -Tclm--epoch--- --total-cpu-usage-- ---load-avg--- ------memory-usage----- epoch |usr sys idl wai stl| 1m 5m 15m | used free buff cach 1548760014| 2 3 93 3 0|0.95 2.01 2.11|1618M 61.9M 12.3M 181M 1548760015| 3 13 82 2 0|0.95 2.01 2.11|1616M 81.6M 12.0M 167M |
Example: View CPU usage by core. |
# dstat -c -C 0,1,total-----cpu0-usage----------cpu1-usage-------total-cpu-usage--
usr sys idl wai stl:usr sys idl wai stl:usr sys idl wai stl
1 3 93 3 0: 2 3 92 3 0: 2 3 93 3 0
10 30 3 56 0: 20 25 0 56 0: 15 27 2 56 0 |
Example: Output the execution result log to a file. |
# dstat –output dstat.csv |