当前位置:网站首页>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;
边栏推荐
- [day ui] affix component learning
- Use the open source tool k8tz to gracefully set the kubernetes pod time zone
- Who is the fish and who is the bait? Summary of honeypot recognition methods from the perspective of red team
- 如何高效的分析online.log
- Cohere、OpenAI、AI21联合发布部署模型的最佳实践准则
- Open source monitoring system Prometheus
- Perhaps the greatest romance of programmers is to commemorate their dead mother with a software
- CVPR 2022 | interprétation de certains documents de l'équipe technique de meituan
- openGauss内核:简单查询的执行
- How stupid of me to hire a bunch of programmers who can only "Google"!
猜你喜欢

LVGL库入门教程 - 颜色和图像

我真傻,招了一堆只会“谷歌”的程序员!

One article explains R & D efficiency! Your concerns are

Definition and use of constants in C language

Use abp Zero builds a third-party login module (I): Principles

1、贪吃蛇游戏设计

Use the open source tool k8tz to gracefully set the kubernetes pod time zone

C语言中常量的定义和使用

Creation and use of unified links in Huawei applinking

敏捷之道 | 敏捷开发真的过时了么?
随机推荐
[database] final review (planning Edition)
手把手教你用AirtestIDE无线连接手机!
Teach you how to use airtestide to connect your mobile phone wirelessly!
【概率论期末抱佛脚】概念+公式(不含参数估计)
How can junior middle school developers effectively reduce their own workload?
Definition and use of constants in C language
Leetcode 1218. Longest definite difference subsequence
Attack popular science: DDoS
Are you still working hard to select *? Then put away these skills
Generate the NC file of 4-D air pressure and temperature, and then read the code (provide the code)
How to efficiently analyze online log
“我这个白痴,招到了一堆只会“谷歌”的程序员!”
关于被黑数据库那些事
Metamask项目方给Solidity程序员的16个安全建议
39 - read XML node and attribute values
一文理解OpenStack网络
物联网?快来看 Arduino 上云啦
面试官:MySQL 数据库查询慢,除了索引问题还可能是什么原因?
Open source monitoring system Prometheus
The introduction of MySQL memory parameters is divided into two categories: thread exclusive and global sharing