All-Around system monitoring tool dstat

Source: Internet
Author: User
All-Around system monitoring tool dstat 1. what is dstat? With man help, we can see that the official definition of dstat is: versatiletoolforgeneratingsystemresourcestatistics ). The information obtained is similar to dstat, an all-around System monitoring tool. 1. what is dstat? With man help, we can see that the official definition of dstat is: versatile tool for generating system resource statistics ). The information obtained is similar to a collection of multiple tools such as top, free, iostat, and vmstat. it is officially interpreted as a multi-functional alternative to tools such as vmstat, iostat, and ifstat, many additional functions (Dstat is a versatile replacement for vmstat, iostat and ifstat. dstat overcomes some of the limitations and adds some extra features .); the results can be saved to csv files and analyzed and utilized using scripts or third-party tools (such as through monitoring platform or to database ). Install the basic server on Centos 6. x by default. you may need to install the basic server manually on other operating systems. II. basic usage of dstat: the default options of 2.1 dstat are the same as those of many commands. the default options of the dstat command are available. the dstat command is executed without any parameters, by default, it collects data of-cpu-,-disk-,-net-,-paging-, and-system-once a second. By default, dstat is the same as dstat-cdngy 1 or dstat-a 1. 2.2 Common dstat options: dstat usage: dstat [-afv] [options...] [delay [count] use dstat-h to view all options. here we will not list them one by one. The following describes common options: # directly follow numbers, indicates that data is collected every second. the default value is one second. dstat 5 indicates that the cpu status is updated every five seconds-c, -- CPU statistics on cpu status, including user, system, and idle (percentage of idle waiting time ), wait (wait for disk IO), hardware interrupt (hardware interrupt), software interrupt (software interrupt), etc.;-d, -- disk statistics disk read/write status-D total, sda counts the specified disk or summary information-l, -- load statistics system load, including 1 minute, 5 minutes, 15 minutes average-m, -- mem statistics system physical memory usage, including used, buffers, cach E, free-s, -- swap statistics on swap used and remaining-n, -- net statistics on network usage, including receiving and sending data-N eth1, total collects statistics on eth1 interface traffic-r, -- io collects I/O requests, including read/write requests-p, -- proc collects process information, including runnable, uninterruptible, new-y, -- sys statistics system information, including interruption and context switching-t display statistical time, which is very useful for analyzing historical data -- fs statistics file opens and inodes above are the most common options, generally, they are used in combination. some of them are commonly used: dstat-cmsdnl-D sda9-N lo, etho 100 5. meaning of parameters on the monitoring interface (part) Procs r: number of processes running and waiting (CPU time slice). This value can also be used to determine whether to increase the number of CPU (more than 1 for a long time). B: The number of processes in the non-disruptive status, i/O is a common cause. Memoryswpd: switch the memory to swap memory (in KB by default ). If the value of swpd is not 0, or it is still relatively large, for example, more than m, but the value of si and so is 0 for a long time, we don't have to worry about this situation, it won't affect the system performance. Free: idle physical memory buff: as the buffer cache memory, buffer cache for reading and writing block devices: as the page cache memory, file system cache. If the cache value is large, it indicates that the number of files in the cache is large. if files frequently accessed can be cached, the disk read IO bi will be very small. Swapsi: Swap memory usage, memory transferred from disk so: Swap memory usage, when the memory transferred from disk memory enough, these two values are all 0, if these two values are greater than 0 for a long time, the system performance will be affected. Both disk IO and CPU resources are consumed. I found that some of my friends thought that the memory was not enough when they saw little or nearly zero free memory. In fact, they could not just look at this, but also combined with si, so, if there are few free items, but few si and so items (mostly 0), you don't have to worry. the system performance will not be affected at this time. Disk IObi: total data read from the block device (read disk) (KB/s) bo: data written to the block device (write disk) (KB/s) note: during random disk read/write, the larger the two values (such as 1 M), the larger the CPU wait value in IO, Systemin: the number of interruptions per second. cs: the larger the value above, the more CPU time consumed by the kernel will be seen: the CPU time consumed by the user process is higher than the value of us, it indicates that the user process consumes a lot of CPU time, but if it exceeds 50% for a long time, we should consider optimizing the program algorithm or accelerating (such as PHP/Perl) sys: when the value of sys is high, it indicates that the system kernel consumes many CPU resources, which is not a benign result. we should check the cause. Wai: when the percentage of CPU time consumed by I/O wait is high, the I/O wait is serious, which may be caused by a large number of random access to the disk, it may also be the bottleneck of the disk bandwidth (block operation ). Idl: percentage of time when the CPU is idle 4. Advanced usage of dstat the function of dstat is very powerful. in addition to the common usage above, there are some advanced usage that are not commonly used, as shown below: 3.1 find out the processes and users that occupy the most resources-top-(io | bio | cpu | cputime-avg | mem, we can see that the user's process occupies the relevant system resources, which is very effective for system tuning. For example, you can use dstat -- top-mem -- top-io -- top-cpu: 3.2 to view information about the processes that currently occupy the most I/O, cpu, and memory: in addition to critical system information, dstat can also obtain other application information. you can obtain other common application information by using the following options: -- postfix display postfix queue size -- sendmail display sendmail queue size -- ntp display ntp server time -- nfs3 get nfs client information -- nfsd3 get nfs server information, however, the nfs server version must be the third edition. For more information about this option, see man for help -- mysql5-(cmds | conn | io | keys ).
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.