Use of dstat for process management in linux
Dstat is a multi-function system resource monitoring tool that supports many features, such: cpu, memory, load, file lock, socket, network, process, paging file, file system, and so on can all be displayed one by one.
Dstat: The http://pkgs.repoforge.org/dstat/ can be directly installed using yum if centos is not installed, and can be downloaded from the above site if you do not want to use yum installation.
This is the dstat interface. It will refresh the system status and return the content to the screen. If you enter dstat directly, the program will prompt "you have not made any filtering status, -cdngy will be used as the default option. "The following describes these options.
Common options:
-C: displays cpu usage
-D: displays the disk usage.
-N: displays network I/O information.
-G: displays paging files.
-Y: System related data
-M: memory-related data
-P: displays processes.
-S: swap space information
-- Fs: File System related data
-R: Total io
-- Lock: file lock
-- Socket: socket File
-- Top-cpu: displays the processes that occupy the most cpu.
-- Top-bio: display the process that occupies the most block device io
-- Top-mem: displays the processes that consume the most memory.
-- Top-io: display the process that occupies the most io
............
Of course, there are more options for users to choose from. You can directly use-h or -- help or man manual to obtain help information.
If we need to make the program automatically stop after outputting a certain amount of content, we can enter "dstat 1 3" and the program will automatically exit after the fourth display (these numbers can be customized .)
When too many parameters are provided, dstat determines whether the terminal can display the complete information. If the display is incomplete, dstat displays the information according to the standard output.
I gave it here-cdngymp (displays cpu, disk, network, paging files, system information, memory, and processes) after the seven options are executed, the program returns the content of the first line, prompting that the terminal width is too small. In this case, end the program to enlarge the terminal and use it.
Let's see if it automatically exits. Previously, using dstat 1 3 means to refresh the first line and exit after the first line is displayed.
If the number 1 is changed to 2, it indicates that the data is refreshed twice from each row starting from the second row and then returned to the user, please try it by yourself... But I use ubuntu), and the rest is just a few exercises, just write it here.