当前位置:网站首页>CPU status information us, sy and other meanings
CPU status information us, sy and other meanings
2022-06-24 13:23:00 【Chen Bucheng I】
One . Overview overview
For example, there is... In one second 100 individual cpu Time slice , This cpu Time slice is cpu The smallest unit of work . So this 100 individual cpu Time slice is operated in different areas and purposes , It represents the area occupied by cpu Time ratio . That's what we get here cpu Time percentage .
The following for TOP Command to see the information , Each parameter will represent cpu The distribution of time slice occupied , All of the following add up to 100%.
as follows ,%Cpu(s) Calculate for all , How many cores are 100% Of the displayed process %CPU For a single core , Occupy a core for 100%,2 One is 200%
Two . Detailed explanation
us and sy
us User space occupancy CPU percentage sy Kernel space footprint CPU percentage
user CPU Usage rate , Including user status CPU Usage rate (user) And low priority user mode CPU Usage rate (nice), Express CPU Percentage of running time in user mode CPU High usage , It usually indicates that some applications are busy .
System CPU Usage rate , Express CPU Percentage of time in kernel mode ( Not including interruptions ). System CPU High usage , The kernel is busy .
4G The process address space of ( Memory ) Artificially divided into two parts – User space and kernel space . User space from 0 To 3G(0xc0000000), Kernel space occupied 3G To 4G. In general, a user process can only access the virtual address of the user space , Can't access the virtual address of kernel space . The exception is that only user processes make system calls ( Execute in kernel mode on behalf of the user process ) You can access the kernel space at any time .
So kernel operations take up kernel space , Process operation takes up process space
User space corresponding process , So whenever the process switches , The user space will change ; The kernel space is mapped by the kernel , It doesn't change with the process , Is constant . Kernel space address has its own page table , User processes have different page tables .
The user space of each process is completely independent 、 Irrelevant .
ni
Within the user process space , Change the priority of the process occupied CPU percentage
Processes have priority , If you adjust the priority , Cost cpu Of the time period , Then consume this ni
If ni Very high , That is, processes may change priorities frequently ( Current understanding )
id
The rest id Except id To occupy cpu The free part of the time slice , Equivalent to space cpu Percent of .
wa
wa refer to CPU Time to wait for disk write to complete , That is, the premise is to IO operation .
It's going on IO During operation , If the program is blocked , He cpu Will wait for the data to be written to the disk to complete the write operation . So at this point cpu The waiting time is wa.
give an example : Use cp Copy , If there are multiple files in the folder , Every time he copies ,cpu Command file copying , But when the hard disk is read and written ,cpu Is to wait , Now cpu Don't act just wait .
So if a machine sees wa Very high , So the general description is disk IO Problems arise , have access to iostat Wait for the command to continue the detailed analysis .
hi and si
Specific description of software and hardware interrupt
If the program is OK , That's not true hi and si Of . When typing on the keyboard ,cpu We have to deal with this thing immediately , That's the interruption , This means that the current operation is interrupted to handle something that needs to be handled immediately .
The theory of soft interrupt is the same as that of hard interrupt , But the software , See the detailed description for details
st
st The explanation is real-time , But it's about virtualization
such as centos on kvm( virtual machine , similar win Of vmver), Then check on this computer st Very high
Currently understood as , For virtual machines cpu Number of time slices used . For example, open 2 A virtual machine , The virtual machine is used cpu It is also provided by the real machine , Here should be the number of virtualization applications .
View each cpu The state of mpstat mpstat -P ALL
irq: Hardware interrupt CPU The dosage ; sofr: Software interrupt CPU The dosage ; iowait: That's what it says wa steal: Time spent serving other tenants ( Don't understand, ); guest: Time spent on guest virtual machines ( Don't understand, );
3、 ... and . summary
user CPU and Nice CPU high , Indicates that the user state process takes up more CPU, So we should focus on troubleshooting process performance problems
System CPU high , It shows that kernel state takes up more CPU So we should focus on checking the performance of kernel threads or system calls
if %iowait The value of is too high , Indicates that the hard disk exists I/O bottleneck ;
if %idle When the value of is high but the system response is slow , It could be CPU Waiting to allocate memory , At this time, the memory capacity should be increased ;
if %idle The value of continues to be lower than 1, It's systematic CPU Processing power is relatively low , Indicates that the most important resource to be solved in the system is CPU;
边栏推荐
- I have fundamentally solved the problem of wechat occupying mobile memory
- Are you still working hard to select *? Then put away these skills
- On the value foam of digital copyright works from the controversial nature of "Meng Hua Lu"
- [data mining] final review (sample questions + a few knowledge points)
- Cmput 379 explanation
- Who said that "programmers are useless without computers? The big brother around me disagrees! It's true
- "I, an idiot, have recruited a bunch of programmers who can only" Google "
- I enlighten a friend and my personal understanding of the six patriarchs' Tan Jing
- YOLOv6:又快又准的目标检测框架开源啦
- AGCO AI frontier promotion (6.24)
猜你喜欢

不用Home Assistant,智汀也开源接入HomeKit、绿米设备?

1、贪吃蛇游戏设计

“有趣” 是新时代的竞争力

About the hacked database

Getting started with the lvgl Library - colors and images

Comparator sort functional interface

Detailed explanation of abstractqueuedsynchronizer, the cornerstone of thread synchronization

YOLOv6:又快又准的目标检测框架开源啦

The data value reported by DTU cannot be filled into Tencent cloud database through Tencent cloud rule engine

“我这个白痴,招到了一堆只会“谷歌”的程序员!”
随机推荐
‘高并发&高性能&高可用服务程序’编写及运维指南
MySQL master-slave replication
hands-on-data-analysis 第三单元 模型搭建和评估
Integrate API interface parameter Dictionary of accounts of multiple local distribution companies - Express 100
Party, Google's autoregressive Wensheng graph model
面试官:MySQL 数据库查询慢,除了索引问题还可能是什么原因?
Opengauss kernel: simple query execution
CVPR 2022 | 美团技术团队精选论文解读
Main steps of system test
[day ui] affix component learning
SCRM, a breakthrough in the new consumption era
Comparator sort functional interface
Geological disaster early warning monitoring RTU
Summary of the process of restoring damaged data in MySQL database
Without home assistant, zhiting can also open source access homekit and green rice devices?
How can junior middle school developers effectively reduce their own workload?
Interviewer: the MySQL database is slow to query. What are the possible reasons besides the index problem?
一文理解OpenStack网络
Integrated API interface code of domestic express companies for intra city distribution and ordering - Express 100
Why did the audio and video based cloud conference usher in a big explosion of development?