Linux Resource Manager-top

Source: Internet
Author: User

This section briefs the top commands in Linux.

 

The top command is a common performance analysis tool in Linux. It can display the resource usage of various processes in the system in real time, similar to the Windows Task Manager.
The following describes how to use it.

In Linux, enter top, and press enter as follows:
Top-01:06:48 up, 1 user, load average: 0.06, 0.60, 0.48
Tasks: 29 total, 1 running, 28 sleeping, 0 stopped, 0 zombie
CPU (s): 0.3% us, 1.0% Sy, 0.0% Ni, 98.7% ID, 0.0% wa, 0.0% hi, 0.0% Si
Mem: 191272 k total, 173656 K used, 17616 K free, 22052 K Buffers
Swap: 192772 k total, 0 K used, 192772 K free, 123988 K cached

PID user PR Ni virt res shr s % CPU % mem time + command
1379 root 16 0 7976 2456 S 1980 0.7. 03 sshd
14704 root 16 0 2128 980 R 796 0.7. 72 top
1 root 16 0 1992 632 s 544 0.0. 90 init
2 root 34 19 0 0 s 0.0 0.0. 00 ksoftirqd/0
3 root RT 0 0 0 s 0.0 0.0. 00 watchdog/0

The following describes the information displayed above:
Statistical information area
The first five lines are the overall statistics of the system. The first line is the task queue information, which is the same as the execution result of the uptime command. The content is as follows:

01:06:48 current time
Up system running time, format: minute
1 user current Login User count
Load average: 0.06, 0.60, 0.48 system load, that is, the average length of the task queue.
The three values are the average values from 1 minute, 5 minutes, and 15 minutes ago to the present.

Second and Third, information about the process and CPU. When multiple CPUs exist, the content may exceed two rows. The content is as follows:

Tasks: 29 total process count
1. Number of Running Processes of Running
28 sleeping sleep Processes
0 stopped process count
0 zombie botnets
CPU (s): 0.3% us CPU usage
1.0% Sy CPU usage in kernel space
0.0% percentage of CPU used by processes that have changed their priorities in Ni user process space
98.7% ID idle CPU percentage
0.0% wa CPU time percentage waiting for Input and Output
0.0% hi
0.0% Si

Memory information of the last two behaviors. The content is as follows:

Mem: 191272 k total physical memory
Total physical memory used by 173656 K used
17616 K free Free Memory Total
Memory usage of 22052 K buffers as kernel Cache
Swap: 192772 k total number of swap Areas
Total number of swap areas used by 0 K used
192772 K free swap zone total
The total number of swap areas of the 123988 K cached buffer.
The content in the memory is swapped out to the swap zone and then into the memory, but the used swap zone has not been overwritten,
This value indicates the size of the SWAp zone where the content already exists in the memory.
When the corresponding memory is swapped out again, you do not have to write data to the swap zone.

Process Information area
The details of each process are displayed at the bottom of the statistics area. First, let's take a look at the meaning of each column.

column name
a pid process id
B ppid parent process id
C ruser real user name
D uid user ID of the process owner
E User: User Name of the process owner
group name of the F group process owner
G tty terminal name of the started process. Processes not started from the terminal are displayed?
h pr priority
I ni nice value. A negative value indicates a high priority. A positive value indicates a low priority.
the last CPU used by j p, only meaningful in multi-CPU Environments
K % percentage of CPU time occupied by the last CPU update to the present
L total CPU time used by the time process, unit: seconds
m Time + total CPU time used by the process, unit: 1/100 seconds
N % mem percentage of physical memory used by the Process
o total virtual memory used by the virt process, in KB. Virt = swap + Res
the swap size in the virtual memory used by the P SWAp process, in KB.
the size of the physical memory used by the Q res process and not swapped out, in KB. Res = code + Data
the physical memory size occupied by the Code executable code, unit: KB
physical memory occupied by parts other than the executable code (Data Segment + stack), unit: KB
t shr shared memory, unit: KB
U nflt page error count
Number of modified pages that the last time v. N was written to the present.
w s Process status.
d = uninterrupted sleep
r = running
S = sleep
T = tracking/stopping
Z = botnets
X command/command line
Y wchan if the process is sleeping, displays the system function name in sleep
Z flags task flag. For more information, see sched. h

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.