cpupower

Manage CPU frequency scaling, governors, and power states.

Category: Performance CPU frequency power-management governor

Install

# RHEL / Alma / Rocky
sudo dnf install kernel-tools

# Debian / Ubuntu
sudo apt install linux-tools-common linux-tools-$(uname -r)

# openSUSE
sudo zypper install cpupower

# Arch
sudo pacman -S cpupower

What it does

cpupower allows administrators to inspect and control CPU frequency scaling, governors, idle states, and performance policies. It is commonly used for performance tuning and power optimization.

How it works (mechanical)

  • Interfaces with the Linux cpufreq subsystem.
  • Modifies scaling governors (performance, powersave, etc.).
  • Adjusts min/max frequency limits.
  • Requires root privileges for changes.
  • Works only if CPU scaling driver is loaded.

Quick Start

# Show CPU info and current governor
cpupower frequency-info

10 Practical Examples

# 1) Show CPU frequency information
cpupower frequency-info
# 2) Show available governors
cpupower frequency-info | grep governor
# 3) Set performance governor
sudo cpupower frequency-set -g performance
# 4) Set powersave governor
sudo cpupower frequency-set -g powersave
# 5) Set minimum frequency
sudo cpupower frequency-set -d 1.2GHz
# 6) Set maximum frequency
sudo cpupower frequency-set -u 3.5GHz
# 7) Show idle states
cpupower idle-info
# 8) Monitor CPU frequency live
watch -n 1 "cat /proc/cpuinfo | grep MHz"
# 9) Check driver in use
cpupower frequency-info | grep driver
# 10) Reset governor to ondemand (if available)
sudo cpupower frequency-set -g ondemand

Notes & Gotchas

  • Settings may not persist after reboot unless configured via systemd or profile scripts.
  • Some CPUs use intel_pstate or amd_pstate drivers.
  • Improper limits can reduce performance or cause thermal throttling.
  • Combine with monitoring tools like htop or lscpu.
  • Useful for benchmarking and database tuning.

Historical Context

As CPUs gained dynamic frequency scaling, Linux introduced cpufreq. cpupower became the unified user-space control tool for managing scaling policies.

Modern Equivalent

Modern systems often auto-manage scaling via power-profiles-daemon or systemd services, but cpupower remains essential for manual tuning and performance diagnostics.

Related Commands

  • numactl — manage NUMA memory/CPU policy.
  • lscpu — display CPU architecture info.
  • htop — monitor CPU usage.
  • watch — monitor command output live.
  • taskset — set CPU affinity.