Skip to main content

CPU Scaling and

Published: June 25, 2011

Greg's tip of the day!

I like to run on my computers. I want the CPU frequency to stay pinned at the lowest possible frequency while is running. I also want my computer to boost it's CPU speed if I'm using it for something else. Using Linux, this is easy to accomplish. First you'll want to make sure that is running with a low 'nice' priority level (it does this by default). Secondly, you'll want to add this to your /etc/rc.local:

echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load

By doing this, you're telling Linux to use the minimum CPU speed possible for programs with a 'nice' (e.g. low) priority level while giving it permission to boost the CPU speed if necessary for other software running on computer. Lower CPU speeds require less electricity and this leads to cheaper electric bills - both a good thing :)

One final caveat... after all that work, your computer will probably still use a few more watts than it would if it were completely idle at the lowest clock speed. This is because it is doing work that requires the CPU to use more circuits than it would in a normal idle loop. Caveat aside, you'll still be using a lot less power than if your CPU were allowed to run at the top clock speed, and only a small amount more than it would normally idle!