The Linux system can use the top command to view information about the system's CPU, memory, run time, swap partition, thread execution, and so on. With the top command, you can find out where the system's flaws are. is not enough memory, CPU processing capacity, IO Read and write too high.
Connect to a remote Linux system using the Sshclient client. Use the top command to view the current running situation of the system. A simple illustration of the results of the top command execution, with detailed explanations for each of the following.
The first line of the top command, top-19:56:47 up, 3 users, Load average:0.00, 0.00, 0.00, shows the current time of the system, the time the system has been running so far, the number of users currently logged on to the system, System load (average length of the task queue) three values are 1 minutes, 5 minutes, 15 minutes ago to the current average "this three is generally less than 1, if it lasts higher than 5, please carefully check that the program affects the operation of systems" "
The second line of the top command "tasks:120 Total, 2 running, 118 sleeping, 0 stopped, 0 zombie" shows the contents in turn "number of processes started", "number of running Processes", "number of pending Processes", "stopped in "Number of processes", "zombie process".
The third line of the top command "CPU (s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st" displays the contents of "User space occupied CPU percentage", "Kernel space consumption CPU Percent "," process that has changed priority in user space CPU percentage "," Idle CPU percentage "," Percentage of CPU time waiting for input and output "," total time spent on CPU service for hardware interrupts "," total time spent on CPU service soft interrupt "," steal "
The top command, line fourth "mem:508820k total, 480172k used, 28648k free, 41944k buffers" displays the contents in order of "amount of physical memory", "used Physical memory", "Idle Physical Memory", "kernel slow The amount of memory ".
The top command, line 5th "swap:392184k Total, 0k used, 392184k free, 259152k cached" Displays the contents in order of "amount of swap area", "total used area of interaction", "Total idle swap area", "buffered intersection The total number of swap zones.
The top command line 5th "PID USER PR NI VIRT RES SHR S%cpu%MEM time+ COMMAND" is displayed in order "process ID", "Process owner", "Priority", "nice value", negative indicates high priority, positive Values represent low priority, total virtual memory used by the process, the amount of physical memory that is used by the process, the size of the non-swapped out, the shared memory size, the process state, the last update to the current CPU time consumption percentage, the percentage of physical memory used by the process, the total CPU time used by the process, command name, command line.