linux top command to view CPU

 

top command is mainly used to view process-related information, view the system while it also provides average load, cpu information and memory information

Real-time monitoring system resource usage

[root @ localhost ~] $ Top          // dynamic resource utilization in view the process, every three seconds refresh 
[root @ localhost ~] $ Top -c       // dynamic resource utilization in view the process, but will show the process in detail cOMMAND command-line information, refer to the following explanation 
[root @ localhost ~] $ Top -bn1     // static display all processes

 

top commonly used shortcut keys:

S   # change the refresh rate, the default is refreshed once every three seconds 
N   # to the size of the PID of the process of descending order list 
P   # to see which process CPU-large to large to small sort 
M   # to see which process is using high memory for large to sort small 
1   # number 1 for monitoring the status of each logical CPU view multicore CPU 
H   # display help information 
q   # quit top

 

 

Detailed top output

Top - 10:07:26 up 37 Days, 17:47, 2 the Users, the Load Average: 0.12, 1.52, 1.81         # denote the current system time, the system has been running time, the number of users log in, the system load 
Tasks: 156 total, 1 running, 155 Sleeping, 0 stopped, 0 zombie                # numbers represent the total number of processes, running processes number, the number of blocked processes, stop the process, zombie numbers 
% Cpu (s): 3.0 us , 2.0 sy, 0.0 Ni, 84.8 the above mentioned id, WA 9.9, 0.0 hi, 0.3 Si, 0.0 ST     # represent the percentage of user process running CPU-intensive, the percentage of system processes running CPU-intensive, ...... 
KiB Mem: 1,882,892 Total , 75236 Free, 1,643,764 used, 163 892 BUFF / cache         # respectively represent the total physical memory size, free physical memory size, physical memory size has been, used as a buffer / cache physical memory size 
KiB Swap: 0 total, 0 free , 0 used. Mem Avail 44492          # total amount of physical memory swap partition, respectively, the total amount of free swap, swap the used amount, available for allocation

  PID the USER PR the NI VIRT RES SHR S % the CPU% MEM the TIME + the COMMAND          # PID: Process ID 
 2489 git 20 0 727 084 426 532 2288 S 1.3 22.7 0: 04.25 bundle           # the USER: process owner of 
   27 root 20 0 0 0 0 S 0.7 0.0 4: 54.73 kswapd0          # priority of the process: PR 
17363 git S 20 0 788 360 432 036 1656 0.7 22.9 0: 23.54 bundle           # the NI: Nice value, a negative value indicates a high priority, positive values indicate a low priority 
10451 git 20 0 950100 58708 0.3 3.1. 1 S 0: 48.47 Ruby             # VIRT: process uses the size of virtual memory 
10592 gitlab- 20 is 0 + 131 432 10228 1816 0.3 0.5 0 S: 37.60 redis_exporter   # the RES: process uses the size of physical memory
18611 the root 20 is 0 0 0 0 S 0.3 0.0 0: 00.02 kworker / 0: 2      # the SHR: process uses shared memory size 
18880 the root 20 is 0 159876 1312 600 R & lt 0.3 0.1 0: 00.05 Top              # S: state of the process, D = sleep, R = running state, S = sleep, T = stopped state, Z = zombie 
    . 1 the root 20 is 0 125 440 1800 412 S 0.0 0.1. 8: 34.00 systemd          # % CPU: percentage process CPU- 
    2 root 20 0 0 0 0 S 0.0 0.0 0: 00.26 kthreadd         # % MEM: percentage process consumes physical memory 
    . 3 the root 20 is 0 0 0 0 S 0.0 0.0 0: 26.92 the ksoftirqd / 0      # the tIME +: when the process uses the total CPU long 
    5 root 0 -20 0 S 0.0 0.0 0 0 0: 00.00 kworker / 0: 0H     #COMMAND: Process using the command line, use the top -c can view the detailed command line 
    7 root RT 0 0 0 0 0.0 0.0 0 S: 00.00 Migration / 0    
     8 20 0 0 0 0 root S 0.0 0.0 0: 00.00 rcu_bh
     9 root 20 0 0 0 0 S 0.0 0.0 4: 19.63 rcu_sched

 

Guess you like

Origin www.cnblogs.com/mingerlcm/p/10899788.html