gpt4 book ai didi

linux - 如何获取系统ioWait

转载 作者:太空狗 更新时间:2023-10-29 11:34:57 24 4
gpt4 key购买 nike

我如何获得系统 ioWait?这最好通过使用/proc 接口(interface)的信息(我猜它写在那里的某个地方)这样应用程序可以检测到这一点,但是从我的应用程序对 exec() 的外部调用是可以接受的。

最佳答案

这在 /proc/stat 中可用。

来自内核源代码中的文档:

The very first "cpu" line aggregates the numbers in all of the other "cpuN" lines. These numbers identify the amount of time the CPU has spent performing different kinds of work. Time units are in USER_HZ (typically hundredths of a second). The meanings of the columns are as follows, from left to right:

  • user: normal processes executing in user mode
  • nice: niced processes executing in user mode
  • system: processes executing in kernel mode
  • idle: twiddling thumbs
  • iowait: waiting for I/O to complete
  • irq: servicing interrupts
  • softirq: servicing softirqs
  • steal: involuntary wait

关于linux - 如何获取系统ioWait,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1339584/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com