Minimizing Power Consumption in Linux

From JimboWiki
Revision as of 21:12, 28 October 2007 by J (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This page is incomplete
More work needs to be done on this page, so if something is missing, don't be surprised
1 Still working on finding ways to save power
2 Need to finish documenting others

Want to make your laptop battery last longer? Want to lower the power consumption of that awesome Linux based media PC you have? Here's where to start.

This article is written specifically for Ubuntu 7.10 (Gusty Gibbon), but the ideas expressed here can apply to any Linux distribution. Some of the higher-level thought can even be applied to other operating systems.

Overview

The high level concept of battery discharge science that this article depends on is pretty simple - the more load (measured in Watts, abbreviated W) put onto a given battery of a set capacity (measured in Volt Hours, abbreviated Vh), the faster it will drain. So, if we want to make the battery last longer, we need to minimize the load or get a larger capacity battery - obviously. Laptop batteries are expensive, and larger capacity usually means a heavier battery - so new battery maybe not such a good idea.

Of course, none of that battery stuff applies to the power consumption of a desktop machine - and I told you we could lower the power consumption of those too - so new battery definitely not the answer.

That means we have to reduce the power consumption of the computer somehow.

How to Reduce Power Consumption

Intel PowerTOP

Intel makes an open source tool, called PowerTOP, which allows you to see which processes are forcing the computer to jump out of power save mode. It also gives recommendations for other ways to save power and will even automatically implement some of the suggested measures for you if you like. Ubuntu users can get PowerTOP from the apt repositories:

sudo apt-get install powertop

Run the tool as root for maximum benefit

sudo powertop

PowerTOP will cover most of the following topics automatically.

Eliminating Power Hungry Processes

Inefficient programs, like background file indexers or certain server processes, require your computer to come out of power save mode more often. Disable these programs to reduce power consumption. (PowerTOP will detect some such software, but others you'll have to use your brain for)

Special Hardware Features

Certain pieces of physical hardware may have special power save features that are not taken advantage of by default.

SATA Hard Drive Power Save

SATA drives have a special power save mode which allows the drive to spin down to a slower speed when not in use. This feature is circumvented if the Linux kernel is set to poll all drives for new media (which it is by default on most distributions). The idea of this setting is to detect CDs or memory sticks being inserted or removed. This never happens to a hard drive, so shut this feature off. (PowerTOP detects this very well, and implements a fix for you)

CD-ROM Auto Poll

Following on the same idea as the last topic, we can shut off the auto-poll for all drives to save even more power. Keep in mind, this will affect any auto-mounting features that you have in place in your distribution.

Automated Kernel Actions

Virtual Memory Dirty Write Rate

The Linux "tickless" Kernel Feature