您的位置:首页 > 运维架构 > Linux

linux top命令中CPU 占用说明

2016-07-28 19:10 465 查看
前几天玩虚拟化,发现虚拟机里面top命令显示cpu占用st类型的很高,之前一般st都是0,于是就好奇,进一步挖掘:

Top命令中CPU占用分别说明如下(参考man top):

us, user    : time running un-niced user processes

sy, system  : time running kernel processes

ni, nice    : time running niced user processes

id, idle    : time spent in the kernel idle handler

wa, IO-wait : time waiting for I/O completion

hi : time spent servicing hardware interrupts

si : time spent servicing software interrupts
st : time stolen from this vm by the hypervisor

st指的是当前VM中的cpu cycle被虚拟化偷走的比例。

举例来说,一个8 vCPU的物理机,开了4个虚拟机,每个指定的CPU资源都是8个vCPU,当这2个虚拟机都满负荷跑的时候,那么top命令里面st就会很高。

比如我这里的例子,在物理机上面运行8个死循环实例loop程序,KVM虚拟机里面配置4个vCPU,运行4个loop程序。

物理机top显示如下,其中KVM占用300%(表示虚拟机占用),物理机CPU占用全部显示是us(user)。

 


虚拟机top显示如下,可以看到us和st分别占用了不少,us表示运行loop的CPU消耗,st表示被物理机中的实例偷走的CPU占用。



 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux cpu