Linux performance analysis command top

Source: Internet
Author: User
Top is the most commonly used performance analysis tool in linux. it is an interactive tool that provides the overall performance of the system. for example, information about the processes being executed includes the process ID and memory usage.

Top is the most common performance analysis tool in linux. it is an interactive tool that provides the overall performance of the system. for example, information about the processes being executed includes the process ID, memory usage, and CPU usage. Job Manager similar to window. (Free command to view memory status)
After running:

Let's take a look at the description:
The first line is the task queue information, which is the same as the execution result of the uptime Command. the specific parameters are described as follows:

14:06:23-current system time

Up 70 days, 16: 44-the system has been running for 70 days, 16 hours, and 44 minutes (during this period, the system has not restarted the restart !)

2 users-there are currently two users logging on to the system

Load average: 1.15, 1.42, 1.44-load average, the three numbers after which are 1 minute, 5 minutes, and 15 minutes respectively.

The load average data checks the number of active processes every five seconds and then calculates the value based on a specific algorithm. If this number is divided by the number of logical CPUs, the system is overloaded when the result is higher than 5.
Line 2: Tasks-task (process). The details are described as follows:

The system now has a total of 206 processes, of which one is running, 205 are sleep, 0 are stoped, and 0 are zombie.

The third line shows the cpu status information. the specific attributes are described as follows:

5.9% us-percentage of CPU used by user space.

3.4% sy-percentage of CPU occupied by kernel space.

0.0% ni-percentage of CPU used by processes with changed priorities

90.4% id-percentage of idle CPU

0.0% percentage of CPU occupied by wa-IO wait

0.0% hi-percentage of CPU used by Hardware IRQ

0.2% CPU usage of si-soft interrupt (Software Interrupts)

The fourth line shows the memory status. The details are as follows:

32949016 k total-total physical memory (32 GB)

14411180 k used-total memory in use (14 GB)

18537836 k free-total idle memory (18 GB)

169884 k buffers-cache memory (169 MB)

The fifth line, swap partition information, the specific information is described as follows:

32764556 k total-total swap zone (32 GB)

0 k used-total used Swap Zone (0 K)

32764556 k free-total number of idle swap areas (32 GB)

3612636 k cached-total buffer swap zone (3.6 GB)

The sixth line is empty.

Row 7: monitors the status of each process (task). the Project column information is described as follows:

PID-process id

USER-Process Owner

PR-process priority

NI-nice value. A negative value indicates a high priority, and a positive value indicates a low priority.

VIRT-total virtual memory used by the process, in kb. VIRT = SWAP + RES

RES-physical memory used by the process, not swapped out, in kb. RES = CODE + DATA

SHR-shared memory size, in kb

S-process status. D = non-disruptive sleep state R = Running S = sleep T = tracking/stopping Z = botnets

% CPU-percentage of CPU time occupied since the last update

% MEM-percentage of physical memory used by the process

TIME +-total cpu time used by the process, in the unit of 1/100 seconds

COMMAND-process name (COMMAND name/COMMAND line)
Command parameters:

-Batch B processing

-C: Display the complete governance command

-I ignore the failure process

-S Security mode

-S cumulative mode

-I <时间> Set the interval

-U <用户名> User name

-P <进程号> Process

-N <次数> Number of cycles
Interactive tools certainly have interactive commands, Interactive command:

H or? : Displays the help screen and provides some brief command summary.

K: terminate a process. The system prompts the user to enter the PID of the process to be terminated and the signal to be sent to the process. Generally, 15 signals can be used to terminate a process. if the process cannot end normally, use signal 9 to forcibly end the process. The default value is signal 15. This command is blocked in security mode.

I: ignore idle and dead processes. This is a switch-on command.

Q: exit the program.

R: reschedule the priority of a process. The system prompts the user to enter the process PID to be changed and the process priority value to be set. Entering a positive value will lower the priority, and vice versa will give the process a higher priority. The default value is 10.

S: switch to the accumulative mode.

S: change the delay time between two refreshes. The system prompts the user to enter a new time in seconds. If there is a decimal number, it is converted to ms. If the input value is 0, the system will be refreshed continuously. the default value is 5 s. It should be noted that if the setting is too small, it is likely to cause constant refresh, so it is too late to see the display, and the system load will increase significantly.

F or F: add or delete a project from the current display.

O or O: change the display Project order.

L: The average load and startup time are displayed during switchover. Displays the first line of the shadow.

M: Switch to display memory information. Displays the shadow memory rows.

T: Process and CPU status information is displayed during switchover. Displays CPU lines in shadow.

C: switch the display command name and the complete command line. The complete command is displayed. This function is useful.

M: Sort by resident memory size.

P: Sort by CPU usage percentage.

T: Sort by time/accumulative time.

W: write the current settings ~ /. Toprc file. This is a recommended method for writing top configuration files.

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.