加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – iostat如何计算CPU闲置时间考虑为%idle或%iowait?

发布时间:2020-12-14 02:56:13 所属栏目:Linux 来源:网络整理
导读:我正在浏览iostat手册页.根据它, %iowait Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request. %idle Show the percentage of time that the CPU or CPUs were idle during which th
我正在浏览iostat手册页.根据它,
%iowait
 Show the percentage of time that the CPU or CPUs were idle during which the system    
 had an outstanding disk I/O request.   

 %idle
 Show the percentage of time that the CPU or CPUs were idle during which the system    
 did not have an outstanding disk I/O request.

我不明白iostat如何确定I / O请求是否优秀.

解决方法

iowait基本上是发送给要服务的设备的I / O请求的平均时间(以毫秒为单位).
这包括队列中的请求所花费的时间以及为其提供服务所花费的时间.

从io调度程序的前面开始逐个测量,直到io完成.它涵盖了完成每个io所需的调度程序,驱动程序,控制器,传输(用于san)和存储所需的时间.它是存储完成的I / O请求的平均时间(以毫秒为单位),包括调度程序队列中的请求所花费的时间以及存储服务所花费的时间.

在传输IO时,存在多个阶段.应用程序发送IO后,会为其分配一个请求,当请求被授予时,内核会看到它是否可以将io合并到任何现有的请求队列.在请求队列中花费的时间会增加总服务时间.然后在合并完成后,将io提交到存储.如果存储处于压力之下或无法处理IO编号,那么我们的IO也必须等待存储服务.因此,基本上有两个等待阶段,iostat测量.

proc文件/ proc / diskstats是它为此目的引用的文件.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读