Using Powertop to Lower System Power Usage

December 14, 2010 Off By David
Object Storage
Grazed from ServerWatch.  Author: Joe Brockmeier.

Ever wonder what’s sucking the life out of your Linux laptop’s battery or contributing to higher electric bills in the server room? Check out Powertop, a tool for profiling a system to see what is using the most power.

Powertop was developed a few years ago to help profile systems and see what could be done to make Linux better at power savings. It was aimed primarily at laptops, as many folks would install Linux on a laptop and then find out that battery performance was far worse under Linux than Windows.

You don’t even need to run Powertop to benefit from it. Some of the most common power-gulping culprits are listed on the LessWatts.org website. Many of these have been fixed in the upstream projects that caused unnecessary wakeups (like ntp waking up every second, or Pidgin checking every 5 seconds to check on idle time). Something as simple as a blinking cursor can cause a wake up every few seconds, and additional power consumption.

But you might want to get a look at what’s going on under your system’s hood specifically. Powertop should be packaged for all major Linux distros, though it might not be installed by default. After installing Powertop, start it up as root (or using sudo) by running powertop. Now you’ll see an output that’s very similar to top but showing the top causes for wakeups. It also displays the ACPI estimate for power usage; at the bottom of the output, it will show suggestions (if any) to improve power performance — or it will notify you of processes preventing the disk from going into powersave mode.

Some of the problems uncovered by Powertop are going to be beyond your control. While Powertop gives several tips that you can follow, like tuning the kernel to reduce wakeups, sometimes it just reports that an application is doing something silly. However, unless you are going to re-write the application yourself, not much can be done about it. You can file a bug though, assuming it’s egregious yet sane enough to fix.

But Powertop will also provide suggestions on how to tune the kernel or make other changes that will provide better power performance. For example, Powertop suggests increasing the timer for writing to disk to decrease the number of wakeups.

You might not get mad power gains from using Powertop, but you can get some useful tips and see what it is that keeps the kernel going even when you’re not doing anything on the computer. It’s also an interesting look at what’s going on behind the scenes, in terms of which applications are writing to disk and when (and to what files). In using Powertop over a period of time, I found that (as expected) USB devices are one of my top sources for power consumption, as well as Firefox — even when it’s just sitting in the background doing nothing. This information comes in handy at various times. For example, if you’re at a conference and trying to conserve battery power, you might want to not have Firefox running all the time.

Spend a few hours with Powertop and you’ll learn much more about what goes on behind the scenes. You might even be able to boost your battery life and be a little greener to boot!