Use the top command in CentOS to view the CPU

Source: Internet
Author: User
Tags memory usage centos cpu usage

CentOS is the product of RHEL (Red Hat Enterprise Linux) source code, and it fixes a number of known bugs on a RHEL basis, and its stability is trustworthy relative to other Linux distributions.

During system maintenance, you may need to look at the CPU usage at any time, and analyze the system condition according to the corresponding information. In CentOS, you can view CPU usage through the top command. When you run the top command, the CPU usage status is displayed in full screen and in a conversational mode-with the command based on top, you can control how the display is displayed, and so on. The command to exit Top is Q (hit Q key once in top run).

You can start top by typing "top" on the command line, as shown in the following figure:

As shown in the figure above, the Full Screen dialog mode for top is divided into 3 parts: The System Information Bar, the command input bar, and the process list bar.

The first part--The top system Information Bar

First line (top):

"00:11:04" is the current moment of the system;

"3:35" to the current operating time after the system is started;

"2 users" for the current user login to the system, or, more specifically, the number of users login to the user's terminal-the same user at the same time to the system more than one terminal connection will be considered as multiple users connected to the system, where the number of users will also appear as the number of terminals;

"Load average" is the average of the current system load, the following three values are 1 minutes ago, 5 minutes ago, 15 minutes before the average process, the general can be considered that the number of CPUs, the CPU will be more laborious load the current system contains processes;

Second line (Tasks):

"Total" is the current number of system processes;

"1 Running" is the number of processes currently running;

"Sleeping" is the number of processes currently in the waiting state;

"0 stoped" is the number of system processes stopped;

"0 Zombie" for the number of recovered processes;

Third line (Cpus):

The current utilization rate of CPU is indicated respectively.

Line Four (MEM):

Represents the total amount of memory, current usage, amount of idle memory, and the amount of RAM used in the buffer;

Line Five (Swap):

Represents a category with line fourth (MEM), but this reflects the usage of swap partitions (swap). Typically, swap partitions (swap) are used frequently, and are considered to be the result of insufficient physical memory.

Part Two--internal command prompt bar in the middle section

The top command allows you to control how the process is displayed through the top's internal commands. The internal command follows the following table:

S-Change the frequency of the screen update

L-The representation of the first line top information on the first section is closed or opened

T-closes or opens the first part the second line of Tasks and third line Cpus information representation

M-to close or open the first section the representation of the four-line Mem and fifth-line Swap information

N-Arranges the list of processes in the order of the PID size

P-Arrange the list of processes in the order of CPU usage

M-Arrange the list of processes in the order of memory usage size

H-Show help

N-Sets the number of processes displayed in the process list

Q-Exit Top

S-Change the screen update cycle

Part three--The process list bar in the bottom section

The PID-Differentiated process list updates periodically according to the set of screens. The top internal command controls how the display is displayed here.

Generally, we maintain the server by remote monitoring, so that the server local terminal running the top in real time is one of the quick and convenient ways to monitor the state of the server locally.

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.