Chapter 9. Managing power consumption with PowerTOP


Reducing the overall power consumption of computer systems helps to save cost. Effectively optimizing energy consumption of each system component includes studying different tasks that your system performs, and configuring each component to ensure that its performance is correct for that job. 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, which means the previous periodic timer interrupts have been replaced with on-demand interrupts. Therefore, idle CPUs are allowed to remain idle until a new task is queued for processing, and 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.

Red Hat Enterprise Linux includes tools to identify and audit applications on the basis of their CPU usage. For details, see Audit and analysis overview and Tools for auditing.

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, which can prevent 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. Ensure that your system is running the latest official firmware, and that power management features are enabled in the BIOS or device configuration settings.

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

If your hardware has support for these features and they are enabled in the BIOS, Red Hat Enterprise Linux uses them by default.

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 situation results in an effectively permanently busy CPU and loses some of the potential power saving if another state had been used.

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, your company can develop a corporate culture focused on "green IT" awareness with a guideline to turn off machines during lunch break or when going home. You also might consolidate several physical servers into one bigger server and virtualize them using the virtualization technology, which 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 usually the exception because the time and cost spent to do so typically outweighs the benefits gained from these last pieces of system tuning. However, performing these tasks once for a large number of nearly identical systems where you can reuse the same settings for all systems can be very useful. 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 against which you can identify regressions or changes in system behavior in the future. The results of this analysis can be very helpful in cases where hardware, BIOS, or software updates happen regularly and you want to avoid any surprises with regard to power consumption. Generally, a thorough audit and analysis gives you a much 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, but 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. Most of them can be used as supplementary sources of information when you want to verify what you have discovered already or when you need more in-depth information about certain parts. Many of these tools are used for performance tuning, which include:

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 are SystemTap tools that collect detailed information about the disk and network activity of all applications running on a system. Using the collected statistics by these tools, you can identify applications that waste power with many small I/O operations rather than fewer, larger operations. Using the dnf install tuned-utils-systemtap kernel-debuginfo command as root, installs 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
[...]
Copy to Clipboard Toggle word wrap
# 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
[...]
Copy to Clipboard Toggle word wrap

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

TuneD
It is a profile-based system tuning tool that uses the udev device manager to monitor connected devices, and enables both static and dynamic tuning of system settings. You can use the tuned-adm recommend command to determine which profile Red Hat suggests as the most suitable for a particular product. For details about TuneD, see Optimizing system performance with TuneD. Using the powertop2tuned utility, you can create custom TuneD profiles from PowerTOP suggestions. For details about the powertop2tuned utility, see Optimizing power consumption.
Virtual memory statistics (vmstat)

A tool provided by the procps-ng package that you can use to view the detailed information about processes, memory, paging, block I/O, traps, and CPU activity. You can use the following 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
Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap
blktrace

Provides detailed information about how time is spent in the I/O subsystem. You can 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]
[...]
Copy to Clipboard Toggle word wrap

The first column, 253,0 is the device major and minor tuple. The second column, 1, gives information about the CPU, followed by columns for timestamps and PID of the process issuing the IO process. The sixth column, Q, shows the event type, the 7th column, W for write operation, the 8th column, 76423384, is the block number, and the + 8 is the number of requested blocks. The last field, [kworker/u16:1], is the process name. By default, the blktrace command runs forever until the process is explicitly killed. You can 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. You can 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
[...]
Copy to Clipboard Toggle word wrap

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, execute 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. It can also be used to verify the effects of power management tuning.

cpupower

The cpupower package contains a collection of tools to examine and tune power saving related features of processors. You can 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
Copy to Clipboard Toggle word wrap
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. For details, see Take control of your RHEL systems’ power consumption with pmda-denki.

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. The PowerTOP tool can provide an estimate of the total power usage of the system and also individual power usage for each process, device, kernel worker, timer, and interrupt handler. 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 terminal and enter:

    # dnf install powertop
    Copy to Clipboard Toggle word wrap

9.6. Starting PowerTOP

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

Prerequisites

  • You are running your laptop on battery power.

Procedure

  • To run PowerTOP, use the following command:

    # powertop
    Copy to Clipboard Toggle word wrap

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
    Copy to Clipboard Toggle word wrap

    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>
    Copy to Clipboard Toggle word wrap

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
    Copy to Clipboard Toggle word wrap
    • 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
      Copy to Clipboard Toggle word wrap
    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
      Copy to Clipboard Toggle word wrap

9.10. Generating an HTML output

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

Procedure

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

    # powertop --html=<htmlfile.html>
    Copy to Clipboard Toggle word wrap

    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
    Copy to Clipboard Toggle word wrap

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
    Copy to Clipboard Toggle word wrap

Procedure

  1. Create a custom profile:

    # powertop2tuned <new_profile_name>
    Copy to Clipboard Toggle word wrap
  2. Activate the new profile:

    # tuned-adm profile <new_profile_name>
    Copy to Clipboard Toggle word wrap

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 allows for fine-grained control of enabled tuning.
  • With powertop2tuned, potentially dangerous tuning is not automatically enabled.
  • With powertop2tuned, rollback is possible without reboot.
Back to top
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

© 2025 Red Hat