4.4. CPU Frequency Governors


The frequency of a CPU affects both performance and power usage. The cpufreq governors determine the frequency of a CPU at any given time based on a set of rules about the kind of behavior that prompts a change to a higher or lower frequency.
Red Hat recommends the cpufreq_ondemand governor for most situations, as this governor provides better performance through a higher CPU frequency when the system is under load, and power savings through a lower CPU frequency when the system is not being heavily used.

Note

When calculating CPU load, the 'ondemand' CPU governor takes into account the sysfs parameter io_is_busy. If this is set to 1, Input/Output (I/O) activity is included in CPU activity calculations, and if set to 0 it is excluded. The default setting is 1. If I/O activity is excluded, the ondemand governor may reduce the CPU frequency to reduce power usage, resulting in slower I/O operations.
The full path for the io_is_busy parameter is /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy.
For maximum performance at the expense of power savings, you can use the cpufreq_performance governor. This governor uses the highest possible CPU frequency to ensure that tasks execute as quickly as possible. This governor does not make use of power saving mechanisms such as sleep or idle, and is therefore not recommended for data centers or similar large deployments.

Procedure 4.1. Enabling and configuring a governor

  1. Ensure that cpupowerutils is installed:
    # yum install cpupowerutils
  2. Check that the driver you want to use is available.
    # cpupower frequency-info --governors
  3. If the driver you want is not available, use the modprobe command to add it to your system. For example, to add the ondemand governor, run:
    # modprobe cpufreq_ondemand
  4. Set the governor temporarily by using the cpupower command line tool. For example, to set the ondemand governor, run:
    # cpupower frequency-set --governor ondemand
The profiles that ship with the tuned-adm tool also make use of CPU frequency governors; for details, see Section 3.6, “Tuned and ktune”.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.