top得到的cpu几个值到底是什么含义?

分类: LINUX

 

 
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
 
一直不太明白,原来这样的:现代分时多任务操作系统,cpu使用时分时段来,比如某个时段A进程cpu处理用了10s,然后B进程30s,然后空闲了60s,那么这个时间内cpu占用率是40%
 
下边是google得到的解释。
 
# us -> User CPU time: The time the CPU has spent running users’ processes that are not niced.
%us cpu耗费在不正常的用户进程的时间。

# sy -> System CPU time: The time the CPU has spent running the kernel and its processes.
 
 系统内核占用时间

# ni -> Nice CPU time: The time the CPU has spent running users’ proccess that have been niced.
 
。。。。。。
# wa -> iowait: Amount of time the CPU has been waiting for I/O to complete.
cpu等待I/0完成的时间总量。

# hi -> Hardware IRQ: The amount of time the CPU has been servicing hardware interrupts.
# si -> Software Interrupts.: The amount of time the CPU has been servicingsoftware
interrupts.
 
 
 
 
 
结论:
系统负载时运行队列的平均长度,也就是等待CPU的平均进程数
所以“Load值=CPU核数”,这是最理想的状态,没有任何竞争,一个任务分配一个核。
由于数据是每隔5秒钟检查一次活跃的进程数,然后根据这个数值算出来的。 如果这个数除以CPU的核数,结果高于5的时候就表明系统在超负荷运转了。
 
PS:load和io也有很大关系,io很忙的机器,基本idle很高,但load也是非常高。
 
使用系统命令top即可看到如下类似信息:
Cpu(s):  0.0%us,  0.5%sy,  0.0%ni, 99.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
但不知什么含义?google之
 
      
     
I try to explain  these:
us: is meaning of "user CPU time"
sy: is meaning of "system CPU time"
ni: is meaning of" nice CPU time"
id: is meaning of "idle"
wa: is meaning of "iowait" 
hi:is meaning of "hardware irq"
si : is meaning of "software irq"
st : is meaning of "steal time"

中文翻译为:

us 用户空间占用CPU百分比
sy 内核空间占用CPU百分比
ni 用户进程空间内改变过优先级的进程占用CPU百分比
id 空闲CPU百分比
wa 等待输入输出的CPU时间百分比
hi 硬件中断
si 软件中断 
st: 实时(来源http://bbs.chinaunix.net/thread-1958596-1-1.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值