起因
近期阅读到Linux下显示CPU执行情况命令top的使用,网上搜索显示为
单位时间io占用cpu比例 ,
cpu等待输入输出,
cpu等待io的时间。
起初看来,总觉得是io瓶颈或者是cpu负载率,仔细琢磨,总觉得哪里出了问题
跟进
因为IO所需要的CPU资源是非常少的,CPU对于IO只是起到调用分派。那为何wa值经常很高。
继续跟进。
-
top不是显示cpu占用情况工具,而是linux系统资源的占用情况。
-
搜索外文
%wa表示 Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.
显示系统有未完成的磁盘I/O请求时CPU或CPU处于空闲状态的时间百分比。
%id表示 Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.
显示CPU或CPU空闲且系统没有未完成的磁盘I/O请求的时间百分比。
两个值对比来看就一目了然了
结论
其实%wa 不单单是cpu使用情况或磁盘io使用情况,而是表明 cpu空闲着但是有许多等待磁盘的操作出现。
如果cpu本身已经使用率很高。同时io操作很多。%wa值也不一定很高。此时也可能io操作出现问题。