Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the command to view cpu usage under linux

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you what is the command to check the use of cpu under linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Use the top command to view cpu usage under linux. Top command is a commonly used performance analysis tool under linux, which can display the resource consumption of each process in the system in real time, similar to the task manager under windows.

Top command is a commonly used performance analysis tool under Linux, which can display the resource consumption of each process in the system in real time, similar to the task manager of Windows.

After running the top command, the CPU usage status is displayed in full screen and in conversation mode-using top-based commands, you can control how it is displayed, and so on. The command to exit top is Q (hit the Q key once while top is running).

Content explanation:

First line (top):

15:24:36 current time of the system

14 operating time from the startup of the days system to now

3 users the number of users currently logged in to the system, or more specifically, the number of terminals logged in to the user-the connection of the same user to multiple terminals of the system at the same time will be regarded as multiple users connected to the system, and the number of users here will also be shown as the number of terminals

The average of the current system load of load average. The last three values are the average number of processes 1 minute ago, 5 minutes ago, and 15 minutes ago, respectively. Generally speaking, when this value exceeds the number of CPU, CPU will be more laborious to load the processes contained in the current system.

The second line (Tasks):

Total number of current system processes in 288 total

1 the number of processes currently running in running

The number of processes currently waiting for sleeping

0 stoped number of system processes stopped

0 zombie number of zombie processes

The third line (Cpus):

7.3% us user space occupies CPU percentage

2.0% sy kernel space occupies CPU percentage

Percentage of CPU occupied by processes that have changed priorities in the process space of 0.0% ni users

90.4% id idle CPU percentage

0.3% percentage of CPU time wa waits for input and output

0.0% hi

0.0% si

0.0% st

Line 4 (Mem):

2042616 total total physical memory

Total physical memory used by 1770116 used

272500 free total free memory

163912 buffers amount of memory used as kernel cache

Line 5 (Swap):

Indicates that the category is the same as the fourth line (Mem), but here reflects the use of the swap partition (Swap). In general, the frequent use of swap partitions (Swap) will be seen as the result of insufficient physical memory.

2094076 Total total Exchange area

45052 Total switching areas used by used

2049024 free total free swap area

346624 Total swap areas for cached buffers

The process list bar at the bottom:

The list of processes distinguished by PID will be updated periodically according to the set screen update time. You can control how it is displayed here through top internal commands:

PID: the ID of the process

USER: process owner

PR: the priority of the process. The smaller the priority is, the more priority it is to execute.

NInice: valu

VIRT: virtual memory consumed by the process

RES: physical memory consumed by the process

SHR: shared memory used by the process

S: status of the process. S indicates hibernation, R indicates running, Z indicates dead state, and N indicates that the priority value of the process is negative

% CPU: CPU usage occupied by the process

% MEM: percentage of physical memory and total memory used by the process

TIME+: the total CPU time taken after the process was started, that is, the cumulative value of the CPU usage time occupied.

COMMAND: name of the process startup command

The above is all the contents of the command to check the usage of cpu under linux. Thank you for your reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report