当前位置:网站首页>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;
边栏推荐
- Attack popular science: DDoS
- 如何高效的分析online.log
- The text to voice function is available online. You can experience the services of professional broadcasters. We sincerely invite you to try it out
- Process basic properties
- Optimization of MP4 file missing seconds caused by TS files when downloading videos from easydss video platform
- Beauty of script │ VBS introduction interactive practice
- #云原生征文#Ingress案例实战
- 如何化解35岁危机?华为云数据库首席架构师20年技术经验分享
- 面试官:MySQL 数据库查询慢,除了索引问题还可能是什么原因?
- On the difference between process and thread
猜你喜欢

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

Getting started with the lvgl Library - colors and images

Main steps of system test

Pycharm中使用Terminal激活conda服务(终极方法,铁定可以)

Getting started with the go Cobra command line tool

Opengauss kernel: simple query execution

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

Creation and use of unified links in Huawei applinking

关于被黑数据库那些事

Getting started with the lvgl Library - colors and images
随机推荐
初中级开发如何有效减少自身的工作量?
Istio Troubleshooting: uneven grpc service load
Integrate API interface parameter Dictionary of accounts of multiple local distribution companies - Express 100
RAID5 array recovery case tutorial of a company in Shanghai
Gateway processing flow of zuul source code analysis
Codereview tool chain for micro medicine
Interviewer: the MySQL database is slow to query. What are the possible reasons besides the index problem?
Nifi from introduction to practice (nanny level tutorial) - environment
Getting started with the go Cobra command line tool
用一个软件纪念自己故去的母亲,这或许才是程序员最大的浪漫吧
Troubleshooting and optimization of files that cannot be globally searched by ordinary users in easydss video platform customization project
手机开户后多久才能通过?在线开户安全么?
一文讲透研发效能!您关心的问题都在
强化学习之父Richard Sutton论文:追寻智能决策者的通用模型
几种常见的DoS攻击
Leetcode 1218. 最长定差子序列
What should I do if I fail to apply for the mime database? The experience from failure to success is shared with you ~
“我这个白痴,招到了一堆只会“谷歌”的程序员!”
J'a i ouvert quelques mots d'un ami et quelques réflexions personnelles sur le livre des six ancêtres
我開導一個朋友的一些話以及我個人對《六祖壇經》的一點感悟