当前位置:网站首页>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;
边栏推荐
- DTU上报的数据值无法通过腾讯云规则引擎填入腾讯云数据库中
- Redis' contribution in the field of microservices
- 敏捷之道 | 敏捷开发真的过时了么?
- Common special characters in JS and TS
- How to create a new empty branch in the web development process of easyrtc?
- Internet of things? Come and see Arduino on the cloud
- 关于被黑数据库那些事
- "I, an idiot, have recruited a bunch of programmers who can only" Google "
- Who said that "programmers are useless without computers? The big brother around me disagrees! It's true
- Brief introduction to cluster analysis
猜你喜欢
随机推荐
Troubleshooting and optimization of files that cannot be globally searched by ordinary users in easydss video platform customization project
实现领域驱动设计 - 使用ABP框架 - 创建实体
ERR AUTH< password> called without anypassword configured for the default user. Ar
Use terminal to activate CONDA service in pypharm (the ultimate method is definitely OK)
LVGL库入门教程 - 颜色和图像
The agile way? Is agile development really out of date?
Implement Domain Driven Design - use ABP framework - create entities
hands-on-data-analysis 第三单元 模型搭建和评估
[day ui] affix component learning
Generate the NC file of 4-D air pressure and temperature, and then read the code (provide the code)
Creation and use of unified links in Huawei applinking
我开导一个朋友的一些话以及我个人对《六祖坛经》的一点感悟
天猫618农产品“百强县” 35个县域来自中西部及东北
手把手教你用AirtestIDE无线连接手机!
Attack Science: DDoS (Part 2)
Leetcode 1218. 最长定差子序列
[database] final review (planning Edition)
Leetcode 1218. Longest definite difference subsequence
How does Argo family bucket make Devops easier?
申请MIMIC数据库失败怎么办?从失败到成功的经验分享给你~