Power Management with cpufrequtils
Productivity Sauce
Switching to a lightweight graphical desktop environment is a great way to improve the overall performance of your system, especially if this system happens to be a notebook or netbook. But if you opt, for example, for LXDE, you'll discover that it lacks a graphical tool for managing power profiles and controlling the processor frequency. This might not be a big problem on a desktop machine, but the ability to adjust power settings is crucial for improving the battery life of your mobile companion. The cpufrequtils utility provides a neat solution to this problem. This utility can help you to tweak power management options from the command line. cpufrequtils is available in the software repositories of most mainstream Linux distributions, so you can install it using your distro's package manager.
Using cpufrequtils is easy. For starters, run the cpufreq-info command to view the processor and power management info. The output of this command should look something like this:
cpufrequtils 006: cpufreq-info (C) Dominik Brodowski 2004-2009 Report errors and bugs to cpufreq@vger.kernel.org, please. analyzing CPU 0: driver: acpi-cpufreq CPUs which run at the same hardware frequency: 0 CPUs which need to have their frequency coordinated by software: 0 maximum transition latency: 10.0 us. hardware limits: 800 MHz - 1.60 GHz available frequency steps: 1.60 GHz, 1.33 GHz, 1.07 GHz, 800 MHz available cpufreq governors: conservative, ondemand, userspace, powersave, performance current policy: frequency should be within 800 MHz and 1.60 GHz. The governor "ondemand" may decide which speed to use within this range. current CPU frequency is 800 MHz. cpufreq stats: 1.60 GHz:15.39%, 1.33 GHz:0.51%, 1.07 GHz:0.63%, 800 MHz:83.47% (5988)
There are two lines here that deserve closer attention:
available frequency steps: 1.60 GHz, 1.33 GHz, 1.07 GHz, 800 MHz available cpufreq governors: conservative, ondemand, userspace, powersave, performance
The first line tells you which frequency steps are available for your particular processor, while the second line displays the available power governors.
Using the cpufreq-set command with the -g switch you can enable the desired governor. For example, if your netbook is running on the battery, you might want to enable the conservative or powersave governor:
sudo cpufreq-set -g conservative
Instead of enabling a specific governor, you can set the desired CPU frequency. To do that, you have to enable the userspace governor first:
cpufreq-set -g userspace
You can then use the cpufreq-set command with the -f switch to set the desired CPU frequency:
cpufreq-set -f 800Mhz
That's all there is to it.
Comments
comments powered by DisqusSubscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.
-
Fedora 41 Released with New Features
If you're a Fedora fan or just looking for a Linux distribution to help you migrate from Windows, Fedora 41 might be just the ticket.
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
Good, short, to the point article, but ...
Why not point out a few obvious things the user'll need to know:
(0) infidel /home/keeling/dox/BCM4312_ locate cpufreq
/etc/cpufreqd.conf
/etc/default/cpufreqd
/etc/default/cpufrequtils
/etc/init.d/cpufreqd
/etc/init.d/cpufrequtils
/etc/init.d/loadcpufreq
/etc/laptop-mode/conf.d/cpufreq.conf
...
/usr/share/doc/cpufreqd/README
/usr/share/doc/cpufreqd/README.Debian
/usr/share/doc/cpufreqd/TODO
/usr/share/doc/cpufreqd/changelog.Debian.gz
/usr/share/doc/cpufreqd/changelog.gz
/usr/share/doc/cpufreqd/copyright
/usr/share/doc/cpufrequtils/README.Debian
/usr/share/doc/cpufrequtils/changelog.Debian.gz
/usr/share/doc/cpufrequtils/copyright
/usr/share/doc/cpufrequtils/examples
/usr/share/doc/cpufrequtils/examples/cpufrequtils.loadcpufreq.sample
/usr/share/doc/cpufrequtils/examples/cpufrequtils.sample
/usr/share/doc/libcpufreq0/changelog.Debian.gz