First, the Linux process related knowledge points:
1) Process concept: a process is a running program.
2) Classification of the process:
1. Follow the status of the process :
Operating state: Running
Sleep state: Sleeping
Interruptible: interruptable
Non-disruptive: uninterruptable
Stop state: Stopped
Zombie State: Zombie
2, according to process processing mode :
(1) Batch Process
(2) Interactive process
(3) Real-time process
3, according to the intensity of operation:
CPU Intensive: The Cpu-bound process consumes more CPU time while it is running.
IO-intensive: The io-bound process consumes more I/O time while it is running.
Note: Typically, I/o-intensive priorities are higher than CPU intensive.
3) Follow the process priority level :
(1) Real-time priority: 0-99, the higher the number, the higher the priority
(2) Static priority: 100-139, the smaller the number, the higher the priority
------NOTE: You can use nice to adjust the value of the Nice value range is [ -20,19], corresponding to 100 to 139; start the process with its default nice value of 0; Its default priority is 120.
(3) Dynamic priority: Kernel maintenance, dynamic adjustment;
II. Process Management tools:
1) Process management tool Htop:
The Htop command is an upgraded version of the top command, which is better than the top command, both functionally and in the interface display.
Enter the command #htop into the user interface:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/00/wKioL1R1mImRyS4nAAng5PvXrp4158.jpg "title=" image 1.png "alt=" wkiol1r1mimrys4naang5pvxrp4158.jpg "/> Upper left corner shows CPU, memory, swap area usage, right display task, load, Boot time, the following is the process of real-time status.
Below is the function of F1~F10 and the corresponding letter shortcut keys
f1 |
View instructions for use of Htop |
f2 |
htop settings |
f3 |
search process |
f4 |
incremental process filter |
f5 |
Show tree structure |
f6 |
select sort by |
f7 |
|
f8 |
|
f9 |
|
f10 |
end htop |
support mouse function, mouse click Help or press F1 to display their own assistance
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/01/wKioL1R1mcihOv3zAAPQ1_8kNtA665.jpg "title=" image 1. PNG "alt=" wkiol1r1mcihov3zaapq1_8knta665.jpg "/>
< Strong> mouse click Setup or press F2 to enter Htop Settings page
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/01/wKioL1R1mnbRg9qCAAIYsI98Xk0945.jpg "title=" image 1. PNG "alt=" wkiol1r1mnbrg9qcaaiysi98xk0945.jpg "/>
Options:
-D #: Refresh time interval
-U USERNAME: Displays only the processes of the specified user
-S COLUMN: Sort by the specified field
Interactive commands:
U: Show only the process of the specified user
S: Tracks system calls initiated by the selected process
L: Track files opened by selected process
T: Show Process Tree
A: Set CPU affinity (binds the selected process to a CPU)
2) Process management tool glances:
A powerful system monitoring tool: real-time monitoring of information such as Cpu,meomory,load,swap,network,mount,disk.
Enter the command #glances enter the operator interface
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/03/wKiom1R1nOLgzb55AAZ_GcC6_CA184.jpg "title=" image 1. PNG "alt=" wkiom1r1nolgzb55aaz_gcc6_ca184.jpg "/>
Description of the Glances working interface:
The upper part of the graph is CPU, load (payload), Mem (memory use), swap (swap partition) usage
glances [-BDEHMNRSVYZ1] [-B bind] [-C Server] [-C conffile] [-P port] [-p password] [--password] [-t refresh] [-f file] [- O Output]
Options:
-B: Displays the network card data rate in bytes;
-D: Turn off the disk I/O module
-f/path/to/somewhere: Sets the location of the output file and its format;
-O {html| CSV}
-M: Disable Mount Module
-N: Disable network module
-T #: Specify the Refresh time interval
-1: Data for each CPU is displayed separately
Interactive Commands : There are many interactive commands to define the display information of the glances, and how to sort;
H: Show Help
run the Glances command in C/s mode :
Service mode:
Glances-s-B ipaddr
IPADDR: The native address of your own listener
Client mode:
Glances-c ipaddr
IPADDR: The address that the remote server listens on
3) Process management tool Dstat: Support Plugin
Input #dstat into the operator interface
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/54/03/wKioL1R1p_DjGNP0AAPLRCYS4FM351.jpg "title=" image 1. PNG "alt=" wkiol1r1p_djgnp0aaplrcys4fm351.jpg "/>
Dstat [-AFV] [options:] [Delay [Count]]
Options:
- C: Display CPU statistics, if there are multiple CPU summary statistics
- D: Show disk Statistics, if there are multiple disks summary statistics
- G,--page: Display page information
-I display broken statistics
- l Display system load Information
- m display statistics for memory
- p Show process queue
-R,--io statistical I/O requests, including read and write requests
-S,--swap show swap status
-T,--time displays statistical time, which is useful for analyzing historical data
-y,--sys statistics System information, including interrupts, context switches
--aio: displaying asynchronous IO statistics
--IPC: IPC-related information
--raw: Raw Socket
--tcp: TCP Socket
--udp: UDP socket
--socket: raw, TCP, UDP
--unix: Unix Sock
--TOP-CPU: Show CPU-intensive processes
--top-bio: shows the process that most occupies block IO
--top-mem: show the most memory-intensive processes
--top-io: Most io-intensive process
This article is from "Little Brother Linux" blog, please be sure to keep this source http://9612520.blog.51cto.com/9602520/1582954
Use of the Process management tool Htop/glances/dstat