TOP command and parameter parsing

Source: Internet
Author: User
Tags superuser permission
TOP command and parameter parsing Top command is a common system performance analysis tool in linux. it can display the resource usage of various processes in the system in real time, similar to the windows Task Manager. The following describes how to use it. The following is the part of the top command: the first line shows :... TOP command and parameter parsing Top command is a common system performance analysis tool in linux. it can display the resource usage of various processes in the system in real time, similar to the windows Task Manager. The following describes how to use it.
The following section lists the top commands. The first line shows the current system time, system running time, current user login count, and system load. * The system load average contains three values: average load of the system in the last 1 minute, 5 minutes, and 15 minutes. Generally, the load between 0 and 1.00 is normal for a single processor. if the load exceeds 1.00, it should be noted. In a multi-core processor, your system average value should not be higher than the total number of processor cores. The second line shows the total number of processes, the number of running processes in running, the number of sleeping processes in sleeping, the number of stopped processes, and the number of zombie botnets. The third line shows: % us CPU usage, % sy CPU usage, % ni CPU usage, % id idle CPU usage, % wa wait input/Output (I/O) % hi indicates the time when the CPU was interrupted, % si indicates the time when the cpu was interrupted, and % st indicates the time when the cpu was interrupted, indicates the cpu time stolen by the virtual machine. The id % value usually reflects the idle cpu usage of a system. Row 4 MEM: total physical memory, total physical memory used by used, total free idle memory, and memory used by buffers as the kernel cache. Fifth line SWAP: total number of SWAP areas, total Number of SWAP areas used by used, total number of free SWAP areas, and total number of SWAP areas buffered by cached. The difference between buffers and cached should be noted that buffers refers to the read/write buffer of block devices, and cached refers to the page cache of the file system. They are all underlying mechanisms of the linux operating system to accelerate disk access. Line 6 PID (process number), USER (running USER), PR (priority), NI (nice task value), VIRT (virtual memory usage) VIRT = SWAP + RES, RES (physical memory usage), SHR (shared memory usage), S (process status), % CPU usage (CPU usage ratio), % MEM (physical memory usage ratio), TIME + (accumulative CPU usage TIME), COMMAND name/COMMAND line. The following describes how to use the top command: top [-] [d] [p] [q] [c] [C] [S] [s] [n] parameter description d specifies time interval. Of course, you can use the s interactive command to change it. P only monitors the status of a process by specifying the monitoring process ID. Q This option will refresh top without any delay. If the caller has the superuser permission, top runs with the highest possible priority. S indicates the accumulative mode. S enables the top command to run in safe mode. This removes the potential danger of interactive commands. I so that top does not show any idle or dead processes. C. display the entire command line, not just the command name. The following describes some interactive commands that can be used during top command execution. From the perspective of usage, mastering these commands is more important than mastering the options. These commands are single-letter. if the s option is used in the command line option, some of these commands may be blocked. Ctrl + L erase and override the screen. H or? The help screen is displayed, and some brief command summary is provided. 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 reschedules 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 changes 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 m s. 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 changes the order of projects displayed. L switching displays average load and startup time information. The m switch displays the memory information. T switch displays the process and CPU status information. C switch to display the command name and complete command line. M is sorted based on the resident memory size. P is sorted by CPU usage percentage. T is sorted by time/accumulative time. W write the current settings ~ /. Toprc file. This is a recommended method for writing top configuration files. Shift + M can be sorted by memory 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.