Interpretation of the top command in Linux

Source: Internet
Author: User
Tags cpu usage

The top command is a common performance analysis tool under Linux that shows the resource usage of individual processes in the system in real time, similar to the Task manager for Windows.

Top is used to dynamically monitor the system resources of the process, changing every 3 seconds. This command is characterized by putting the highest processes that occupy system resources (CPU, memory, disk IO, and so on) to the front. The top command prints a lot of information, including system load (Loadaverage), Number of processes (Tasks), CPU usage, memory usage, and swap partition usage.



Detailed command content:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6B/89/wKiom1UvteDxCXFqAANe3vD-rVU396.jpg "title=" Qq20150416202506.png "style=" Float:none; "alt=" wkiom1uvtedxcxfqaane3vd-rvu396.jpg "/>

First line: top-04:25:26 current system time up 3 min, the system has run time (intermittent operation) 1 user, the number of users currently logged on to the system load average:0.01, 0.03, 0.00 Average Load , three numbers mean the average load of 1 minutes, 5 minutes, 15 minutes, respectively.

Load average represents the number of processes that are active over a period of time, and the larger the values, the greater the pressure on your server. In general, this value does not matter if it does not exceed the number of CPUs on the server. If you exceed the number of CPUs for a long time, then you should pay attention.


Second line: tasks: Task, total, number of processes 1 running, number of running processes sleeping, number of processes in hibernation 0 stopped, number of processes stopping state 0 zombie Zombie Process
Third line: CPU (s): CPU status 0.0%us, percentage of CPU time consumed by the user 0.0%sy, percentage of CPU time consumed by the system 0.0%ni, percentage of CPU time that the priority process is taking up 99.8%id, percentage of time the CPU is idle 0.0%w A, the percentage of CPU time consumed by I/O waits 0.2%hi, the hard interrupt (Hardware IRQ) takes up a percentage of the CPU 0.0%si, the soft interrupt (software interrupts) consumes the percentage of the CPU 0.0%st the total of the stolen CPU Ratio (usually 0, no attention)
Line four: Mem: Memory Status 1030416k Total, amount of physical memory 79928k used, memory used 950488k free, idle memory 10308k buffers buffer size (about to be written to disk)
Line five: Swap: Swap partition 2047996k Total, swap area totals 0k used, size 2047996k free, idle size 36296k cached cache size (read from disk )
Line Six (empty)
Line seventh: The PID process ID user process belongs to the users PR process priority NI Process precedence value (nice value) The total amount of virtual memory used by the VIRT process in the KB RES process used, not The amount of physical memory swapped out, KB SHR shared memory S process state%CPU Last updated to current CPU time consumption percent%MEM process uses the percentage of physical memory time+ process uses the total CPU time, single Bit 1/100 seconds command process name (command name/command line)

Among them, the PR is the real-time priority of the process (related to the kernel), the range 0-99, the smaller the number of the lower priority;

The Nice value range is-20-19, the smaller the value, the higher the corresponding process priority, in top, pr-ni=20, the default start a process, nice is 0;

S process Status: d= non-interruptible sleep status r= run s= sleep t= track/stop z= zombie process.


More attention is paid to daily operations:%cpu,%MEM, COMMAND Three, need more attention.

In the top state, press the keypad number "1" to monitor the status of each logical CPU:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6B/84/wKioL1UvtzTD-0fuAAHWXoiEq_0796.jpg "style=" float: none; "title=" Qq20150416210952.png "alt=" Wkiol1uvtztd-0fuaahwxoieq_0796.jpg "/>


In the top state, press SHIFT + M to sort by memory usage size

TOP-BN1 it represents the use of non-dynamic printing system resources, that is, all the information is output at once rather than dynamic display , can be used in shell script
Top-c the right-most command to display more detailed information

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6B/84/wKioL1UvuHPSCUQtAAOJdEOWxA0274.jpg "title=" Qq20150416212003.png "alt=" Wkiol1uvuhpscuqtaaojdeowxa0274.jpg "/>






Reference Link: http://www.jb51.net/article/40807.htm

Provide help: http://www.aminglinux.com/bbs/forum.php

Interpretation of the top command in Linux

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.