环境:
升级最新内核(更新软件包)后, 监控系统IO负载出了问题, (异常信息)描述如下
CONFIG_TASK_DELAY_ACCT not enabled in kernel, cannot determine SWAPIN and IO %
Starting with Linux kernel 5.14.x task_delayacct is configurable at
runtime and set to off by default. This setting can be changed in
interactive mode by the Ctrl-T shortcut. In batch mode a warning is
printed when the setting is OFF. From the command line this can be
enabled or disabled.从 Linux 内核 5.14.x 开始,task_delayacct 可在运行时配置并默认设置为关闭。可以通过 Ctrl-T
快捷键在交互模式下更改此设置(指的是iotop-c中, 而不是python版的iotop)。在批处理模式下,当设置为 OFF
时会打印警告。通过命令行方式可以开启或者关闭相关选项。It is advisable to keep this option off when not using this or another
monitoring program because when enabled it has some effect on system
performance. 建议在不使用此或其他监视程序时关闭此选项,因为启用时 它对系统性能有一些影响。
# 1.修改内核配置, 开启
➜ ~ sudo sysctl kernel.task_delayacct=1
# iotop版本与效果
➜ ~ iotop --version
iotop 0.6
➜ ~ sudo iotop -o -P -a # 此时会正常
# 2.修改内核配置, 再次禁用/关闭
# 建议在不使用iotop或其他监视程序时关闭此选项,因为启用时 它对系统性能有一些影响。
sudo sysctl kernel.task_delayacct=0
在iotop-c(C语言实现的版本)对应的交互窗口中, Ctrl+T
切换配置开关
参考: