[Linux Command]top

Source: Internet
Author: User

The top command can view the overall operation of the system in real time, and is a practical tool to synthesize the performance and operation information of the multi-party information monitoring system. The interactive interface provided by the top command can be managed with a hotkey.

top-09:44:56[current system time], days[system has been running for 16 days], 1 user[users currently logged in], load average:9.59, 4.75, 1.92[system load, that is, the average length of the task queue] Tasks:1 total[Total Processes], 2 running[number of processes running], 143 sleeping[sleep process], 0 stopped[stopped processes], 0 zombie[freeze process], CPU (s): 99.8%us[user space occupied CPU hundred Ratio], 0.1%sy[CPU percentage of the kernel space], 0.0%ni[CPU percentage of processes that have changed priority in user process space], 0.2%id[Idle CPU percentage], percentage of CPU time waiting for input and output], 0.0%hi[], 0.0%st[], mem:4147888k total[total physical memory], amount of physical memory used by 2493092k used[], 1654796k free[total free memory], 158188k buffers[used as memory for kernel cache] Swap : 5144568k total[Swap Area total], 56k used[total swap area used], 5144512k free[idle swap area total], 2013180k cached[buffer swap area total],

The details of each process are shown below the statistics area. Let's start by understanding the meaning of the columns.

PID USER PR NI VIRT RES SHR S%cpu%MEM time+ COMMAND

Ordinal column name meaning
PID Process ID
PPID Parent Process ID
Ruser Realusername
User ID of the UID process owner
Username of user Process Owner
Group Process Owner's name
The terminal name of the TTY startup process. Processes that are not started from the terminal are displayed as?
PR-Priority
The Ninice value. Negative values indicate high priority, positive values indicate low priority
P last used CPU, only meaningful in multi-CPU environment
%cpu percentage of CPU time that was last updated to current
The total CPU time, in seconds, used by the duration process
Total CPU time used by the time+ process, Unit 1/100 sec
Percentage of physical memory used by the%MEM process
The total amount of virtual memory used by the VIRT process, in kilobytes. Virt=swap+res
The swap process uses the amount of virtual memory that is swapped out, in kilobytes.
The size, in kilobytes, of the physical memory used by the RES process and not swapped out. Res=code+data
The amount of physical memory the code executable consumes, in kilobytes per kb
The amount of physical memory that is used outside the data executable code (segment + stack), in kilobytes
SHR shared memory size, in kilobytes
Nflt Number of page faults
NDRT the number of pages that were modified the last time it was written to.

Top is also a very good program observation tool! But unlike PS is a static result output, top this program can continuously monitor (monitor) The whole system's program working state, such as the example above is shown! In the case of a preset, the time for each update of the program resource is 5  seconds, but you can use-D to modify it. Top is mainly divided into two pictures, the above screen for the whole system of resource use state, basically a total of six lines, the content of the display is:? First line: Displays the time the system was started, the current number of people on the line, and the overall system load (load). The comparison needs to be noted is the load of the system, three data represents the average load of 1,5,10  minutes, respectively. In general, this load value should be less likely to exceed 1 , unless your system is busy. If it continues above 5 , then ..... Take a closer look at how the program is affecting the overall system!? The second line: shows the current number of observers, the comparison needs to be noted is the last zombie that value, if not 0  Take a good look at the end of the process and become a corpse, right? Line three: Shows the overall load of cpu , which can be used per project? Inspection. Need to observe the value of the ID (idle), in general, he should be close to 100% to be good, that the system is very few resources are used Ah! ^_^.? Line four and line fifth: represents the current use of physical memory and virtual memory (MEM/SWAP). Line six: This is where the state is displayed when the command is entered in the top program. Example four is a simple example of use. As for the top of the picture, it is the resource situation used by each process. The comparison needs to be noted:? PID&NBSP: id  of every process!? User: The user to whom the process belongs; Pr :priority shorthand, the order of priority execution of the program, the smaller the sooner it is executed; The abbreviation of Ni :nice is related to priority, and the smaller the sooner it is executed; %cpu:cpu  use rate;? %MEM: Memory utilization;? time+:cpu  the use of time; In general, if the brother wants to find out the most loss of cpu  resources of the program, most of the use of the top this program! Then force the cpu  to use the resources to sort (press p  in top), and you'll soon know! ^_^. A lot of love with this goodOh, it's something to use!




[Linux Command]top

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.