Introduction - Linux power optimisation guide v 1.03
This guide is designed to assist and aid inexperienced Linux users to increase battery life in response to the common complaint of lower battery life in Linux.
Be warned that in many instances, the power saving advice may reduce the overall performance of your laptop, a trade-off some deem worthy for added battery life.
If you do not understand what you are doing, please ask! Tweaking without knowing is a bad idea!
Tweaks were performed on a Lenovo s10e with Fedora 15. Tweaks may not apply to all distributions.
Inbuilt Power Saving Programmes
Many Linux distributions contain methods of conserving power, such as lowering the screen brightness or making the disk idle when not in-use. These are distribution specific, so rather than listing all of them, you will probably find them in your system settings. These should be your first port-of-call.
Power Management Tweaks
Depending on your distribution, there may be guides already set up for your distribution of Linux. For example Fedora maintains a list of common tweaks to lower power consumption.
It is best to refer to each individual distribution's guides if they already exist. However, many of the tweaks mentioned below should work for any distribution.
Fedora - Simple tips to reduce power usage
Use a properly dimensioned system for the job (no need for overpowered systems for simple Desktop use e.g.)
For servers consolidate services on fewer systems to maximise efficiency of each system
Enforce turning of systems that are not used (e.g. company policy)
Unplug and/or turn of peripherals that aren't used (e.g. external USB devices, monitors, printers, scanners)
Turn of unused hardware already in BIOS.
Disable power hungry features.
Enable CPU scaling if supported for ondemand CPU governor. DONT use powersave governor, typically uses more power than ondemand (race to idle).
Put network card to 100 mbit/10 mbit:
10 mbit: ethtool -s eth0 advertise 0x002
100 mbit: ethtool -s eth0 advertise 0x008
Doesn't work for every card
Put harddisk to spindown fast and full power saving:
hdparm -S240 /dev/sda (20m idle to spindown)
hdparm -B1 /dev/sda (Max powersave mode)
Make sure writes to hd don't wake it up too quickly:
Set flushing to once every 5 minutes
echo "30000" > /proc/sys/vm/dirty_writeback_centisecs
Enable laptop mode
echo "5" > /proc/sys/vm/laptop_mode
Use relatime for your / partition
mount -o remount,relatime /
Disable CD-ROM polling from HAL (prevents popups when a CD is inserted):
hal-disable-polling --device /dev/scd0
Enable USB autosuspend by adding the following to the kernel boot commandline:
Screensaver needs to dpms off the screen, not just make colors black. To turn of monitor after 120s when X is running:
xset dpms 0 0 120
Linux Power Regression
For users running the 2.6.38 kernel and beyond, a problem has arisen from the 2.6.38 kernel changes resulting in significantly higher power consumption.
For users of the 3.2 kernel there is a kernel patch available!
The power-saving feature known as 'pcie_aspm' has been disabled on computers whose BIOS reports it to be incompatible or suggests it to be turned off. 'pcie_aspm' is designed to power down unused PCI-E lanes.
Powertop is a Linux power monitoring programme designed to reduce the power consumption of laptops by offering power consumption optimisation advice. This is an invaluable tool for beginner and experienced Linux users alike.
You can easily install this programme in Ubuntu, Linux Mint, Fedora and other various distributions.
Powertop is often included with the mainstream distributions.
Ubuntu, Mint and derivatives
sudo apt-get install powertop
Fedora, Mandriva and derivatives
yum install powertop
Powertop, regardless of the distributions is launched from terminal.
You should be presented with a screen similar to this:
For the more advanced and adventurous, cpufrequtils is a programme which allows the throttling of CPUs to reduce power consumption. Obviously lowering the clock speed will also lower the performance of the system. A well written guide by the Arch Linux team is available.