Linux-top the meaning of each field after the command output

Source: Internet
Author: User
Tags set time

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. Here is a detailed description of how it is used. Top is a dynamic display process where the current state can be refreshed continuously with the user key. If the command is executed in the foreground, it will monopolize the foreground until the user terminates the program. More accurately, the top command provides real-time status monitoring of the system's processor. It will display the most "sensitive" CPU in the system. Task List. This command can be used by CPU. Memory usage and execution time to sort tasks, and many of the features of the command can be set through interactive commands or in personal customization files.

1 . command format:

Top [parameters]

2 . Command function:

Displays information about the processes currently being executed by the system, including process IDs, memory usage, CPU utilization, etc.

3 . Command parameters:

-B Batch Processing

-C Displays the complete ruling command

-I ignores the failure process

-S Secret mode

-S cumulative mode

-i< time > Set time interval

-u< User name > Specify user name

-p< Process number > Specify process

-n< number of times > cycle display

4 . usage Examples:

Example 1: Displaying process information

Command:

Top

Output:

Authorized only. All activity would be monitored and reported. Last login:wed Jan 19:43:28 at 125.77.51.57Authorized only. All activity would be monitored and reported. [[EMAIL&NBSP;PROTECTED]_HW ~]$ toptop-11:40:23 up 518 days, 19:05, one users, load average:0.00, 0.00, 0.00tasks:132 t Otal, 1 running, sleeping, 0 stopped, 1 zombiecpu (s): 0.1%us, 0.2%sy, 0.0%ni, 99.7%id, 0.0%wa, 0.0%hi, 0.0   %si, 0.0%stmem:16436124k Total, 4619264k used, 11816860k free, 903176k buffersswap:8385920k total, 0k used,                                                                                 8385920k free, 3395380k cached PID USER PR NI VIRT RES SHR S%cpu%MEM time+ COMMAND 3861 openims 0 12772 1136 844 S 0.7 0.0 0:16.15 to P 4136 openims 16 0 12772 1140 8                                                              0.0 S 0.3 0:12.57 Top                        4356 openims 0 12772 1144 844 S 0.3 0.0 0:10.05 Top                                                                                        1 Root 0 10376 640 548 S 0.0 0.0 0:03.34 Init   2 root RT-5 0 0 0 S 0.0   0.0 0:00.00 migration/0 3 Root 34                                                                                 0 0 0 S 0.0 0.0 0:00.32 ksoftirqd/0                                                                                 4 root RT-5 0 0 0 S 0.0 0.0 0:00.00 MIGRATION/1                                                                                 5 Root 0 0 0 S 0.0 0.0 0:00.92 KSOFTIRQD/1 6 root RT-5 0 0 0 S 0.0 0.0 0:00.0           0 MIGRATION/2                                                                      7 Root 0 0 0 S 0.0 0.0 0:0    0.93 KSOFTIRQD/2 8 root RT-5 0                                                                                 0 0 S 0.0 0.0 0:00.00 MIGRATION/3                                                                                9 Root 0 0 0 S 0.0 0.0 0:00.14 KSOFTIRQD/3                                                                                   Root 10-5 0 0 0 S 0.0 0.0 2:47.95 events/0                                                                                   Root 10-5 0 0 0 S 0.0 0.0 0:01.05 EVENTS/1 Root 10-5 0 0 0 S 0      .0 0.0 0:01.17 EVENTS/2 root 10-5 0 0 0 S  0.0 0.0 0:01.10 EVENTS/3 Root                                                                                   10-5 0 0 0 S 0.0 0.0 0:00.70 khelper                                                                                   151 root 10-5 0 0 0 S 0.0 0.0 0:00.00 kthread                                                                                 158 root 10-5 0 0 0 S 0.0 0.0 0:00.03 kblockd/0 159 Root 10-5 0 0 0 S 0.0 0.0 0     : 00.03 KBLOCKD/1 Root 10-5                                                                                 0 0 0 S 0.0 0.0 0:00.66 KBLOCKD/2                                                                            161 Root 10-5 0 0 0 S 0.0 0.0 0:00.03 KBLOCKD/3     162 Root 14-5 0 0 0 S 0.0 0.0 0:00.00 kacpid                                                                                  323 root 11-5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0 324 root 12-5 0 0 0 S 0.0 0.0 0:00.00 cque  UE/1 325 root 12-5 0 0 0      S 0.0 0.0 0:00.00 CQUEUE/2 326 root                                                                                  12-5 0 0 0 S 0.0 0.0 0:00.00 CQUEUE/3                                                                                     329 Root 11-5 0 0 0 S 0.0 0.0 0:00.00 KHUBD                                   331 root 10-5 0 0 0 S 0.0 0.0 0:00.00 kseriod                                                421 Root 0 0 0 0 S 0.0 0.0 0:00.01 KHUNGTASKD 422 Root 0 0 0 0 S 0.0 0.      0 0:00.00 Pdflush 423 root 15 0                                                                                   0 0 0 S 0.0 0.0 0:31.31 Pdflush                                                                                   424 Root 11-5 0 0 0 S 0.0 0.0 0:00.00 kswapd0                                                                                     425 Root 11-5 0 0 0 S 0.0 0.0 0:00.00 aio/0 426 Root 11-5 0 0 0 S 0.0 0.0 0:00.00 AI    O/1 427 Root 11-5 0 0 0 S 0.0 0.0 0:00.00 AIO/2 428 root 11-5 0 0 0 S 0.0 0.0 0:00.00 AIO/3 634                                                                                 Root 11-5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused       699 Root 10-5 0 0 0 S 0.0 0.0 0:00.33 mpt_poll_0

  

Description

Statistical Information Area :

The first five elements are the statistical information area of the current system situation as a whole. Let's look at the specific meaning of each line of information.

The first line, the task queue information, and the execution results of the uptime command, specify the following parameters:

14:06:23-Current system time

Up to 70 days, 16:44-the system has been running for 16 hours and 44 minutes (during which the system has not restarted the Yo!). )

2 users-currently has 2 users logged into the system

The three numbers behind the load average:1.15, 1.42, 1.44-load average are 1-minute, 5-minute, 15-minute loads respectively.

The load average data is the number of active processes that are checked every 5 seconds and then calculated by a particular algorithm. If this number is divided by the number of logical CPUs, the result above 5 indicates that the system is overloaded.

The second line, tasks-task (process), specific information is as follows:

The system now has 206 processes, of which there are 1 running, 205 in hibernation (sleep), 0 in the stoped state, and 0 in the zombie State (zombie).

The third line, CPU status information, the specific properties are described as follows:

5.9%us-the percentage of CPU occupied by the user space.

3.4% sy-The percentage of CPU consumed by the kernel space.

0.0% ni-The percentage of CPU that has changed the priority of the process

90.4% id-Idle CPU percentage

0.0% Wa-io waiting for CPU percentage

0.0% hi-Hard Interrupt (Hardware IRQ)% of CPU occupied

0.2% si-Soft Interrupt (software interrupts)% of CPU occupied

Note: In this case the CPU usage ratio differs from the Windows concept, and you need to understand the Linux system user space and kernel space knowledge!

Line four, the memory state, the specific information is as follows:

32949016k total-Total Physical memory (32GB)

14411180k used-Total Memory in use (14GB)

18537836k free-Total free memory (18GB)

169884k buffers-Cache Memory (169M)

Line five, swap swap partition information, specific information as follows:

32764556k total-Swap Area total (32GB)

Total swap area used by 0k used-(0K)

32764556k free-Total Idle swap area (32GB)

3612636k cached-Buffer Swap area total (3.6GB)

Note:

The total amount of memory in use in row four (used) refers to the amount of memory that is now controlled by the system kernel, and the total amount of free memory that the kernel has not included in its control range. The memory that is included in kernel management is not always in use, but also includes the memory that has been used in the past that can now be reused, and the kernel does not return these reusable memory to free, so there is less memory on Linux, but don't worry about it.

If you are accustomed to calculating the number of available memory, here is an approximate formula: The fourth line of Free + fourth row buffers + fifth row of cached, according to this formula this server's available memory: 18537836k +169884k +3612636k = 22GB or so.

For memory monitoring, in the top we have to monitor the fifth line swap partition used, if this value is constantly changing, indicating that the kernel is constantly in memory and swap data exchange, which is really not enough memory.

Line six, blank line.

Line seventh below: status monitoring of each process (task), the project column information is described as follows:

pid-Process ID

user-Process Owner

pr-Process Priority

The Ni-nice value. Negative values indicate high priority, positive values indicate low priority

The total amount of virtual memory used by the virt-process, in kilobytes. Virt=swap+res

The size, in kilobytes, of the physical memory used by the res-process and not swapped out. Res=code+data

shr-shared memory size, in kilobytes

S-process state. d= non-disruptive sleep status r= run s= sleep t= track/stop z= zombie Process

%cpu-percentage of CPU time that was last updated to current

Percentage of physical memory used by the%mem-process

Total CPU time used by the time+-process, Unit 1/100 sec

command-Process Name (command name/command line)

Linux-top the meaning of each field after the command output

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.