top得到的cpu几个值到底是什么含义?
2010-11-17 17:19:46
分类: LINUX
一直不太明白,原来这样的:现代分时多任务操作系统,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.
# 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的时候就表明系统在超负荷运转了。
由于数据是每隔5秒钟检查一次活跃的进程数,然后根据这个数值算出来的。 如果这个数除以CPU的核数,结果高于5的时候就表明系统在超负荷运转了。