CPU Frequency Scaling

Introduction
If you have a very powerful machine and are not using all of the power the CPU provides, it may be using more power than you need. Side effects are raised power bills, reduced battery life on a notebook and increased heat output. I'm on a Pentium-4 right now and it's a very hot summer, it makes good sense to me to decrease the heat output to prevent crashing in the ambient heat.

Governor
The CPUFreq governor decides at which frequency your processor will run. The most interesting ones are 'ondemand' and 'conservative'. Choose whatever suits your needs best:


 * Performance sets the speed to maximum, essentially disabling frequency scaling.
 * Powersave drops CPU to its lowest supported frequency.
 * Userspace allows the CPU speed to be set manually or dynamically by software.
 * Ondemand runs at the lowest possible frequency and increases to maximum when CPU usage hits 100%.
 * Conservative runs at the lowest possible frequency and increases incrementally as more power becomes necessary.

You can choose as many as you want and switch them anytime. Also be sure to select a default governor (cannot be compiled as a module).

Scaling Driver
You'll also need to enable your system's clock adjustment driver.

Userspace Software
If you want to change the CPUFreq behavior from the default you set earlier during kernel configuration, there are several software packages for managing CPU frequency settings.

Cpufrequtils
Cpufrequtils is a set of userspace tools for changing the kernel-level CPUFreq governor, or setting the CPU frequency manually (requires userspace governor). It also includes a simple daemon for setting these parameters at startup.

To see which governors are available:

Now, knowing which one you want, edit the only worthwhile line in to state which governor you want to use, the default is ondemand. Powersave took mine from 2.4GHz to 300MHz (yes, that IS right, even though it doesn't look it)

Finally, activate the scaling:

To enable scaling at boot time:

Cpudyn
Cpudyn is a daemon that switches between CPUFreq governors based on processor load. Its main advantage over simply using one governor is that the amount of load required to trigger a change is user-configurable. It can also put idle hard disks to sleep after a given period. Unfortunately, it only supports a single cpu (state of program at version 1.0.1).

Powernowd
Powernowd is a daemon with a goal of simplicity and speed. It doesn't try and make too many decisions for you. This program is very simple to run with a basic configuration file at /etc/conf.d/powernowd. It will use the "userspace" governor This program will also support multiple CPUs, and independently controls them (personally verified with CPU burn).

Cpufreqd
Cpufreqd is a very powerful and customizable daemon which can alter CPU frequency (and other ACPI settings) based not only on processor load, but also on battery level, temperature, power source, and what programs are running. Needless to say, it's quite complicated to configure.

Cpufreqd options well described in cpufreqd.conf manpage. Here is a simple working example for acceptable performance when AC used and powersave when AC not used depending on battery charge. If the CPU temperature gets too high, the processor goes into Conservative Low state. Also You can specify profile for different applications and suspend command when AC power is too low.

At the time of editing this paragraph, the latest available stable working version of Cpufreqd was here cpufreqd-2.4.2-r1.ebuild

CPU Frequenz Skalierung