Use the top Command in CentOS to view CPU Loads

Source: Internet
Author: User

CentOS is the product of source code re-Compilation of RHEL (Red Hat Enterprise Linux), and many known bugs have been fixed on the basis of RHEL. Compared with other Linux distributions, CentOS is trustable.

During system maintenance, you may need to check the CPU usage at any time and analyze the system status based on the relevant information. In CentOS, you can use the top command to view CPU usage. After the top Command is run, the CPU usage status is displayed in full screen mode and in dialog mode. The top-based command can be used to control the display mode. The command to exit top is q (Press q once in top running ).
Enter "top" in the command line to start top, as shown in:

As shown in, the top full-screen dialog mode can be divided into three parts: system information, command input, and process list.

Part 1-system information column at the top

The first line (top ):

"00:11:04" indicates the current time of the system, "" indicates the current time of operation after the system is started, and "2 users" indicates the user currently logged on to the system, more specifically, the number of terminals that log on to a user-connections to multiple terminals of the system from the same user at the same time are considered as connections from multiple users to the system, the number of users here will also be the number of terminals; "load average" is the average value of the current system load, the following three values are the average number of processes one minute ago, five minutes ago, and 15 minutes ago. Generally, when this value exceeds the number of CPUs, the CPU will be difficult to load the processes contained in the current system;

Line 2 (Tasks ):

"59 total" indicates the total number of processes in the current system; "1 running" indicates the number of processes in the current running state; and "58 sleeping" indicates the number of processes in the waiting state; "0 stoped" indicates the number of stopped system processes, and "0 zombie" indicates the number of recovered processes;

Row 3 (Cpus ):

Indicates the current CPU usage;

Row 4 (Mem ):

Total memory, current usage, idle memory, and buffer memory respectively;

The fifth line (Swap ):

Indicates that the category is the same as the fourth row (Mem), but this shows the usage of Swap partition (Swap. In general, Swap partitions (Swap) are frequently used and are considered to be caused by insufficient physical memory.

Part 2-Internal Command Prompt bar in the middle

You can use top's Internal commands to control the display mode of processes. The internal commands are as follows:

S-change the screen update frequency l-close or enable the first line of top information in the first line t-close or enable the first part of the second line of Tasks and the third line of Cpus information m-close or enable the expression N of the first part of the fourth line Mem and the fifth line Swap information. In the order of PID size, the process list P is displayed. In the order of CPU usage, the Process List M is displayed. process list in the order of memory usage size h-show help n-set the number of processes displayed in the Process List q-exit tops-change the screen update cycle

Part 3-process list at the bottom

The process list differentiated by PID is regularly updated based on the set screen update time. You can use the top internal command to control the display mode.

In general, we maintain the server through remote monitoring, so that the local terminal of the server runs top in real time, which is one of the fast and convenient ways to monitor the server status locally on the server.


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.