Optimize CPU frequency scaling

By default, RHEL uses CPU frequency scaling to save power and reduce heat under low load. To prioritize performance, set the CPU to maximum clock speed. This helps LVM-VDO run deduplication and compression faster and more efficiently.

About this task

Running the CPU at higher frequency allows resource-intensive operations to complete faster. This can improve overall system throughput and storage optimization results.

Warning
Tuning CPU frequency scaling for higher performance can increase power consumption and heat generation. In inadequately cooled systems, this can cause overheating and might result in thermal throttling, which limits the performance gains.

Procedure

  1. Display available CPU governors:
    $ cpupower frequency-info -g
  2. Change the scaling governor to prioritize performance:
    # cpupower frequency-set -g performance

    This setting persists until reboot.

  3. Optional: To make the persistent change in scaling governor across reboot, create a custom systemd service:
    1. Create a new /etc/systemd/system/cpufreq.service file with the following content:
      [Unit]
      Description=Set CPU scaling governor to performance
      
      [Service]
      ExecStart=/usr/bin/cpupower frequency-set -g performance
      
      [Install]
      WantedBy=multi-user.target
    2. Save the file and exit.
    3. Reload the service file:
      # systemctl daemon-reload
    4. Enable the new service:
      # systemctl enable cpufreq.service

Results

  • Display the currently used CPU frequency policy:
    $ cpupower frequency-info -p
  • Optional: If you made the scaling governor change persistent, check if the cpufreq.service is enabled:
    # systemctl is-enabled cpufreq.service