Chapter 9. Managing power consumption with PowerTOP


Reducing the overall power consumption of computer systems helps to save cost. To optimize energy consumption, study system tasks and configure each component to match the performance requirements of that specific task.

Lowering the power consumption of a specific component or of the system as a whole leads to lower heat and performance. Proper power management results in:

  • Heat reduction for servers and computing centers.
  • Reduced secondary costs, including cooling, space, cables, generators, and uninterruptible power supplies (UPS).
  • Extended battery life for laptops.
  • Lower carbon dioxide output.
  • Meeting government regulations or legal requirements regarding Green IT, for example, Energy Star.
  • Meeting company guidelines for new systems.

9.1. Power management basics

Effective power management is built on the following principles:

An idle CPU should only wake up when needed
Since Red Hat Enterprise Linux 6, the kernel runs tickless. It replaced periodic timer interrupts with on-demand interrupts. Therefore, idle CPUs are allowed to remain idle until a new task is queued for processing. CPUs that have entered lower power states can remain in these states longer.

However, benefits from this feature can be offset if your system has applications that create unnecessary timer events. Polling events, such as checks for volume changes or mouse movement, are examples of such events.

Unused hardware and devices should be disabled completely
This is true for devices that have moving parts, for example, hard disks. In addition, some applications may leave an unused but enabled device "open". When this occurs, the kernel assumes that the device is in use. It prevents the device from going into a power saving state.
Low activity should translate to low wattage
Power efficiency often depends on modern hardware and proper BIOS or UEFI configuration, especially on non-x86 architectures. Install the latest firmware. Enable power management features in the BIOS or system settings to improve power efficiency.

Some features to look for include:

  • Collaborative Processor Performance Controls (CPPC) support for ARM64
  • PowerNV support for IBM Power Systems
  • Cool’n’Quiet
  • ACPI (C-state)
  • Smart

Red Hat Enterprise Linux automatically uses these features when supported and enabled in the BIOS.

Different forms of CPU states and their effects

Modern CPUs together with Advanced Configuration and Power Interface (ACPI) provide different power states. The three different states are:

  • Sleep (C-states)
  • Frequency and voltage (P-states)
  • Heat output (T-states or thermal states)

    A CPU running on the lowest sleep state consumes the least amount of energy, but it also takes considerably more time to wake it up from that state when needed. In very rare cases this can lead to the CPU having to wake up immediately every time it just went to sleep. This permanently busy CPU loses power savings available from more efficient idle states.

A turned off machine uses the least amount of power
One of the best ways to save power is to turn off systems. For example, companies can develop a corporate culture focused on "green IT" awareness under a guideline to turn off machines during breaks or when going home. Consolidate several physical servers into one bigger server and virtualize them by using the virtualization technology. The virtualization technology is shipped with Red Hat Enterprise Linux.

9.2. Audit and analysis overview

The detailed manual audit, analysis, and tuning of a single system is rare. The time and cost spent to do so typically outweighs the benefits gained from these last pieces of system tuning.

Tuning is valuable for large groups of identical systems where you can reuse the same settings. For example, consider the deployment of thousands of desktop systems, or an HPC cluster where the machines are nearly identical.

Another reason for auditing and analysis is to provide a basis for comparison. Use the results to identify regressions or changes in system behavior and to avoid power consumption issues when hardware, BIOS, or software updates occur regularly. Generally, a thorough audit and analysis gives a better idea of what is really happening on a particular system.

Auditing and analyzing a system with regard to power consumption is relatively hard, even with the most modern systems available. Most systems do not provide the necessary means to measure power use by using software. Exceptions exist though:

  • iLO management console of Hewlett Packard server systems has a power management module that you can access through the web.
  • IBM provides a similar solution in their BladeCenter power management module.
  • On some Dell systems, the IT Assistant offers power monitoring capabilities.

Other vendors are likely to offer similar capabilities for their server platforms. However, there is no single solution available that is supported by all vendors.

9.3. Tools for auditing

Red Hat Enterprise Linux offers tools for system auditing and analysis. Use these tools to verify existing findings or gain in-depth information about specific system components.

Many of these tools are used for performance tuning, including:

PowerTOP
PowerTOP identifies specific components of kernel and user-space applications that frequently wake up the CPU. Intel CPU’s Intel Hardware P-State (HWP) adjusts CPU frequency and voltage to regulate the power efficiency and performance. You can use the powertop command as root to start the PowerTOP tool and powertop --calibrate to calibrate the power estimation engine.
diskdevstat and netdevstat

These SystemTap tools collect detailed information about the disk and network activity of all applications running on a system. Use these statistics to detect power-wasting applications performing many small rather than few large I/O operations. Use the dnf install tuned-utils-systemtap kernel-debuginfo command to install the diskdevstat and netdevstat tools. To view detailed information about the disk and network activity, use:

# diskdevstat
PID   UID   DEV   WRITE_CNT   WRITE_MIN   WRITE_MAX   WRITE_AVG   READ_CNT   READ_MIN   READ_MAX   READ_AVG   COMMAND

3575  1000  dm-2   59          0.000      0.365        0.006        5         0.000        0.000      0.000      mozStorage #5
3575  1000  dm-2    7          0.000      0.000        0.000        0         0.000        0.000      0.000      localStorage DB
[...]
# netdevstat
PID   UID   DEV       XMIT_CNT   XMIT_MIN   XMIT_MAX   XMIT_AVG   RECV_CNT   RECV_MIN   RECV_MAX   RECV_AVG   COMMAND
3572  991  enp0s31f6    40       0.000      0.882       0.108        0         0.000       0.000       0.000     openvpn
3575  1000 enp0s31f6    27       0.000      1.363       0.160        0         0.000       0.000       0.000     Socket Thread
[...]

With these commands, you can specify three parameters: update_interval, total_duration, and display_histogram.

TuneD
It is a profile-based system tuning tool. It uses the udev device manager to monitor connected devices and enables both static and dynamic tuning of system settings. Use the tuned-adm recommend command to determine which profile Red Hat suggests as the most suitable for a particular product.
Virtual memory statistics (vmstat)

It is a tool provided by the procps-ng package. It provides detailed information about processes, memory, paging, block I/O, traps, and CPU activity. Use the vmstat command to view this information:

$ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r  b  swpd  free    buff   cache   si   so  bi   bo   in  cs  us  sy id  wa  st
1  0   0   5805576 380856 4852848   0    0  119  73  814  640  2   2 96   0   0

View the active and inactive memory by using the vmstat -a command.

iostat

Provided by the sysstat package, this tool is similar to vmstat, but only for monitoring I/O on block devices. It provides more verbose output and statistics. You can use the following command to monitor the system I/O:

$ iostat
avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           2.05    0.46    1.55    0.26    0.00   95.67

Device     tps     kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
nvme0n1    53.54     899.48     616.99      3445229     2363196
dm-0       42.84     753.72     238.71      2886921      914296
dm-1        0.03       0.60       0.00         2292           0
dm-2       24.15     143.12     379.80       548193     1454712
blktrace

Provides detailed information about how time is spent in the I/O subsystem. Use the following command to view this information in human readable format:

# blktrace -d /dev/dm-0 -o - | blkparse -i -
253,0   1    1   0.000000000  17694  Q   W 76423384 + 8 [kworker/u16:1]
253,0   2    1   0.001926913     0   C   W 76423384 + 8 [0]
[...]
  • The first column, 253,0 is the device major and minor tuple.
  • The second column displays sequence number of the event.
  • The third column displays the CPU id for event occurrence.
  • The fourth column of timestamps.
  • The fifth column of PID of the I/O-issuing process.
  • The sixth column displays the event type. Q for queued process, C for completed process.
  • The seventh column, W for write operation.
  • The eighth column, 76423384, is the block number
  • The ninth column + 8 is the number of requested blocks as a number of bytes in I/O operation.
  • The last field, [kworker/u16:1], is the process name. By default, the blktrace command runs forever until the process is explicitly killed. Use the -w option to specify the run-time duration.
turbostat

It is provided by the kernel-tools package. It reports on processor topology, frequency, idle power-state statistics, temperature, and power usage on x86-64 processors. Use the following command to view the summary:

# turbostat
CPUID(0): GenuineIntel 0x16 CPUID levels; 0x80000008 xlevels; family:model:stepping 0x6:8e:a (6:142:10)
CPUID(1): SSE3 MONITOR SMX EIST TM2 TSC MSR ACPI-TM HT TM
CPUID(6): APERF, TURBO, DTS, PTM, HWP, HWPnotify, HWPwindow, HWPepp, No-HWPpkg, EPB
[...]

By default, turbostat prints a summary of counter results for the entire screen, followed by counter results every 5 seconds. Specify a different period between counter results with the -i option. For example, use turbostat -i 10 to print results every 10 seconds instead. turbostat is also useful for identifying servers that are inefficient in terms of power usage or idle time. It also helps to identify the rate of system management interrupts (SMIs) occurring on the system. Verify the effects of power management tuning with turbostat.

cpupower

The cpupower package contains a collection of tools to examine and tune power saving related features of processors. Use the cpupower command with the frequency-info, frequency-set, idle-info, idle-set, set, info, and monitor options to display and set processor related values.

For example, to view available cpufreq governors, use:

$ cpupower frequency-info --governors
analyzing CPU 0:
  available cpufreq governors: performance powersave
GNOME Power Manager
It is a daemon that is installed as part of the GNOME desktop environment. GNOME Power Manager notifies you of changes in your system’s power status, for example, a change from battery to AC power. It also reports battery status, and warns you when battery power is low.
pmda-denki
pmda-denki monitors power consumption. It’s part of the Performance Co-Pilot suite, and helps to monitor consumption over time, and visualize it.

9.4. The purpose of PowerTOP

PowerTOP is a program that diagnoses issues related to power consumption and provides suggestions on how to extend battery lifetime. PowerTOP estimates total system power usage and consumption for individual processes, devices, and kernel handlers.

The tool can also identify specific components of kernel and user-space applications that frequently wake up the CPU. Red Hat Enterprise Linux uses version 2.x of PowerTOP.

9.5. Installing PowerTOP

You can install PowerTop and start using it to diagnose issues related to power consumption.

Procedure

  • Open the command line and enter:

    # dnf install powertop

9.6. Starting PowerTOP

After you install it on your system, you can start using PowerTop to optimize system performance.

Prerequisites

  • You are running your laptop on battery power.

Procedure

  • To run PowerTOP, enter:

    # powertop

9.7. Calibrating PowerTOP

You can use the PowerTOP calibration process to improve the accuracy of power consumption measurements on your laptop.

Procedure

  • On a laptop, you can calibrate the power estimation engine by running the following command:

    # powertop --calibrate

    Let the calibration finish without interacting with the machine during the process. Calibration takes time because the process performs various tests, cycles through brightness levels and switches devices on and off. When the calibration process is completed, PowerTOP starts as normal. Let it run for approximately an hour to collect data.

    When enough data is collected, power estimation figures will be displayed in the first column of the output table.

9.8. Setting the measuring interval

By default, PowerTOP takes measurements in 20 seconds intervals. But, you can change this measuring frequency based on your requirements.

Procedure

  • To change the measuring frequency, run the powertop command with the --time option:

    # powertop --time=<time_in_seconds>

9.9. Controlling CPU frequency drivers and modes

While using the Intel P-State driver, PowerTOP only displays values in the Frequency Stats tab if the driver is in passive mode. But, even in this case, the values can be incomplete. In total, there are three possible modes of the Intel P-State driver:

  • Active mode with Hardware P-States (HWP)
  • Active mode without HWP
  • Passive mode

Switching to the ACPI CPUfreq driver results in complete information being displayed by PowerTOP. However, it is recommended to keep your system on the default settings.

Procedure

  1. View what driver is loaded and in what mode:

    # cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
    • intel_pstate is returned if the Intel P-State driver is loaded and in active mode.
    • intel_cpufreq is returned if the Intel P-State driver is loaded and in passive mode.
    • acpi-cpufreq is returned if the ACPI CPUfreq driver is loaded.
  2. While using the Intel P-State driver:

    1. Add the following argument to the kernel boot command line to force the driver to run in passive mode:

      intel_pstate=passive
    2. To disable the Intel P-State driver and use the ACPI CPUfreq driver, add the following argument to the kernel boot command line:

      intel_pstate=disable

9.10. Generating an HTML output

You can also generate an HTML report apart from the powertop’s output in the command line.

Procedure

  • Run the powertop command with the --html option:

    # powertop --html=<htmlfile.html>

    Replace the <htmlfile.html> parameter with the required name for the output file.

9.11. Optimizing power consumption

You can use either the powertop service or the powertop2tuned utility to optimize power consumption.

You can use the powertop service to automatically enable all PowerTOP’s suggestions from the Tunables tab on the boot.

Procedure

  • Enable the powertop service:

    # systemctl enable powertop

9.11.2. The powertop2tuned utility

Use the powertop2tuned utility to create custom TuneD profiles from PowerTOP suggestions. By default, powertop2tuned creates profiles in the /etc/tuned/ directory, and bases the custom profile on the currently selected TuneD profile. For safety reasons, all PowerTOP tunings are initially disabled in the new profile. You can enable the tunings by uncommenting them in the /etc/tuned/profiles/profile_name/tuned.conf file.

Use the --enable or -e option to generate a new profile that enables most of the tunings suggested by PowerTOP. Certain potentially problematic tunings, such as the USB autosuspend, are disabled by default and need to be uncommented manually.

You can use the powertop2tuned utility to generate a custom TuneD profile that helps optimize your system’s power consumption.

Prerequisites

  • The powertop2tuned utility is installed on the system.

    # dnf install tuned-utils

Procedure

  1. Create a custom profile:

    # powertop2tuned <new_profile_name>
  2. Activate the new profile:

    # tuned-adm profile <new_profile_name>

You can prefer optimizing power consumption with powertop2tuned over powertop.service for the following reasons:

  • The powertop2tuned utility represents integration of PowerTOP into TuneD, which enables the benefit of both tools.
  • The powertop2tuned utility provides fine-grained control of enabled tuning.
  • With powertop2tuned, potentially dangerous tuning is not automatically enabled.
  • With powertop2tuned, rollback is possible without reboot.
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top