Linux performance article-top usage

Source: Internet
Author: User
Tags sorts

#top

Output:

C: Toggle display command name and full command line. Displays the complete command. This feature is useful.

M: Sorts based on the size of the resident memory.

P: Sorts according to the percentage size of CPU usage.

[[Email protected] log]# toptop - 14:06:23 up 70 days, 16:44,   2 users,  load average: 1.25, 1.32, 1.35Tasks: 206  total,   1 running, 205 sleeping,   0 stopped,    0 ZOMBIECPU (s):   5.9%us,  3.4%sy, 0.0%ni, 90.4%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%stMem:  32949016k total, 14411180k  used, 18537836k free,   169884k buffersswap: 32764556k total,         0k used, 32764556k free,  3612636k  cachedpid   user      pr  ni  virt   RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                    28894  root      22   0 1501m  405m  10m S 52.2  1.3   2534:16 java                                                                       18249  root       18   0 3201m 1.9g  11m s 35.9  6.0 569:39.41 java                                                                       2808  root       25   0 3333m 1.0g  11m S 24.3  3.1  526:51.85 java                                                                      25668  root       23   0 3180m 704m  11m s 14.0  2.2  360:44.53 java                                                                      574    root      25   0 3168m 611m   10m S 12.6  1.9 556:59.63 java                                                                       1599  root      20   0 3237m 1.9g   11m S 12.3  6.2 262:01.14 java                                                                       1008  root      21    0 3147m 842m  10m s  0.3  2.6   4:31.08  java


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 results above 5 indicate 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-Free Swap Area

Total (32GB)

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

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)



User space and kernel space

The user space corresponds to the process, so whenever the process switches, the user space will follow the changes;

While kernel space is mapped by the kernel, it does not follow process changes and is fixed. The kernel space address has its own page table, and the user process has a different page table

How much physical memory can a user process access? How much physical memory can the kernel code access?

The 32-bit system user process can access up to 3GB, and the kernel code can access all physical memory.

The 64-bit system user process can access more than 512GB, and the kernel code can access all physical memory.


Kernel space and user space is the basis of operating system theory, kernel function module runs in kernel space,

While the application is running in user space


Linux performance article-top usage

Related Article

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.