1. Installation
Yum Install Dstat
2. Example
1) directly with the number, representing the # seconds to collect the data, the default is one second; Dstat 5 indicates a 5-second update
This is the information that the default output displays:
CPU Status: CPU utilization. The more interesting part of the report is the display of the user, the system, and the idle part, which better analyzes the current state of CPU usage. If you see the "Wait" column, the state of the CPU is a high usage value, which indicates that there are some other problems with the system. When the state of the CPU is "waits", it is because it is waiting for a response from the I/O device (such as memory, disk, or network) and has not yet received it.
Disk Statistics: read and write operations on disk, this column shows the total number of read and write disks.
Network statistics: network devices send and receive data, this column shows the total number of network receipts and sends data.
Paging Statistics: The paging activity of the system. Paging refers to a memory management technique used to find a system scenario, a large paging indicates that the system is using a large amount of swap space, or that the memory is very fragmented, and in most cases you want to see the value of page in (swapped in) and page out (swapped out) to 0 0.
System Statistics: This item shows interrupts (int) and context switches (CSW). This statistic only makes sense when there are baseline comparisons. The higher statistics in this column usually indicate that a large number of processes are causing congestion and need to focus on the CPU. Your server will normally run some programs, so this always shows some values.
By default, Dstat refreshes the data every second. If you want to exit Dstat, you can press the "Ctrl-c" key.
It is important to note that the first line of the report, usually all the statistics here do not show the value.
This is because Dstat will give a summary through the last report, so the first run time is the data with no mean and total value.
2) However, Dstat can control the reporting interval and the number of reports by passing 2 parameters to run. For example, if you want to Dstat output default monitoring, the report output is 3 seconds apart, and the report outputs 10 results, you can run the following command:
There are many parameters available in the Dstat command, which you can view with the Man Dstat command, and most of the commonly used parameters are:
Versatile tool for generating system resource Statisticsdstat options:-C,--cpu enable CPU stats-c 0,3 , total include cpu0, CPU3 and total-d,--disk enable disk stats-d Total,hda include HDA and Total-g,--page enable page stats-i,--int enable interrupt Stats-i 5,eth2 Include INT5 and interrupt used by ETH2-L,--load enable load stats-m,--mem enable Memory Stats-n,--net Enable network Stats-n eth1,total include eth1 and Total-p,--proc Enable process Stats-r,--io enable IO stats (I/O requests completed)-S,--swap en Able swap stats-s swap1,total include Swap1 and total-t,--time enable Time/date output-t,-- Epoch Enable time counter (seconds since epoch)-Y,--sys enable system stats--aio Enable AIO stats--FS,--filesystem enable FS stats--IPC enable IPC stats--lock enable lock stats --raw Enable raw stats--socket enable socket stats--tcp enable TCP STA TS--udp enable UDP stats--unix enable UNIX stats--VM enable VM St ATS--plugin-name enable plugins by plugin name (see manual)--list list all available plugins -A,--all equals-cdngy (default)-F,--full automatically expand-c,-D,-I,-n and-s lists -V,--vmstat equals-pmgdsc-d total--BW,--blackonwhite change colors for white background terminal--floa T force float values on screen--integer Force integer values on screen--nocolor Disable colors (implies--noupdate)--noheaders Disable repetitive headers--noupdate disable Intermediate Updates--Output file write CSV output to file
Parameter interpretation
-nocolor: Color not displayed (sometimes useful)
-socket: Displaying network statistics
-TCP: Displaying commonly used TCP statistics
-UDP: Displays some dynamic data for the monitored UDP interface and its current usage
-C,--CPU statistics CPU status, including user, system, idle (percentage of idle wait time), wait (waiting for disk IO), hardware interrupt (Hardware interrupt), software interrupt (software interrupt), etc.;
-D,--disk statistics disk read and write status
-D TOTAL,SDA Statistics Specify disk or summary information
-L,--load statistical system load, including 1-minute, 5-minute, 15-minute averages
-M,--mem statistics System physical memory usage, including used, buffers, cache, free
-S,--swap statistics swap used and remaining amount
-N,--net statistics network usage, including receiving and sending data
-N eth1,total Statistics eth1 interface aggregated traffic
-R,--io statistical I/O requests, including read and write requests
-P,--PROC statistics process information, including runnable, uninterruptible, new
-Y,--sys statistics System information, including interrupts, context switches
-T displays statistical time, which is useful for analyzing historical data
Some plugins
Internal: Aio, CPU, cpu24, disk, Disk24, Disk24old, epoch, FS, int, int24, IO, IPC, load, lock, mem, net, page, Page24 , Proc, RAW, socket, swap, swapold, sys, TCP, TIME, UDP, UNIX, Vm/usr/share/dstat: battery, Battery-remain, Cpufre Q, Dbus, Disk-util, Fan, FreeSpace, GPFs, Gpfs-ops, HelloWorld, Innodb-buffer, Innodb-io, Innodb-ops, lustre, Memcach E-hits, Mysql-io, Mysql-keys, Mysql5-cmds, Mysql5-conn, Mysql5-io, Mysql5-keys, Net-packets, nfs3, Nfs3-ops, NFSD3, Nfsd3-ops, NTP, Postfix, Power, Proc-count, RPC, RPCD, SendMail, snooze, thermal, Top-bio, TOP-CPU, Top-cputime, Top-c Putime-avg, Top-io, Top-latency, Top-latency-avg, Top-mem, Top-oom, Utmp, Vm-memctl, Vmk-hba, Vmk-int, vmk-nic, VZ-CPU, Vz-io, VZ-UBC, WiFi
Parameter interpretation
--disk-util: Displays the busy state of a time disk
--freespace: Displays the current disk space utilization
--proc-count: Shows the number of programs that are running
--top-bio: Indicates the maximum block I/O process
--TOP-CPU: Graphically displays the most CPU-intensive processes
--top-io: Shows the most normal I/O processes
--TOP-MEM: Show processes that occupy the most memory
--fs Statistics File open number and inodes number
Give some examples:
Memory who is occupying
Dstat-g-l-m-S--top-mem
CPU Resource Loss
Dstat-c-y-l--proc-count--top-cpu
How to output a CSV file
To export a file in CSV format for later, you can use the following command:
Dstat–output/tmp/sampleoutput.csv-cdn
Dstat of Linux terminal monitoring tools