4.2. Example — Laptop
One other very common place where power management and savings can really make a difference are laptops. As laptops by design normally already use drastically less energy than workstations or servers the potential for absolute savings are less than for other machines. When in battery mode, though, any saving can help to get a few more minutes of battery life out of a laptop. Although this section focuses on laptops in battery mode, you can use some or all of those tunings while running on AC power as well.
Savings for single components usually make a bigger relative difference on laptops than they do on workstations. For example, a 1 Gbit/s network interface running at 100 Mbits/s saves around 3–4 watts. For a typical server with a total power consumption of around 400 watts, this saving is approximately 1 %. On a laptop with a total power consumption of around 40 watts, the power saving on just this one component amounts to 10 % of the total.
Specific power-saving optimizations on a typical laptop include:
- Configure the system BIOS to disable all hardware that you do not use. For example, parallel or serial ports, card readers, webcams, WiFi, and Bluetooth just to name a few possible candidates.
- Dim the display in darker environments where you do not need full illumination to read the screen comfortably. Use System+Preferences → Power Management on the GNOME desktop, Kickoff Application Launcher+Computer+System Settings+Advanced → Power Management on the KDE desktop; or gnome-power-manager or xbacklight at the command line; or the function keys on your laptop.
- Use the
laptop-battery-powersaveprofile of tuned-adm to enable a whole set of power-saving mechanisms. Note that performance and latency for the hard drive and network interface are impacted.
Additionally (or alternatively) you can perform many small adjustments to various system settings:
- use the
ondemandgovernor (enabled by default in Red Hat Enterprise Linux 6)
- enable laptop mode (part of the
echo 5 > /proc/sys/vm/laptop_mode
- increase flush time to disk (part of the
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
- disable nmi watchdog (part of the
echo 0 > /proc/sys/kernel/nmi_watchdog
- enable AC97 audio power-saving (enabled by default in Red Hat Enterprise Linux 6):
echo Y > /sys/module/snd_ac97_codec/parameters/power_save
- enable multi-core power-saving (part of the
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
- enable USB auto-suspend:
for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; doneNote that USB auto-suspend does not work correctly with all USB devices.
- enable minimum power setting for ALPM (part of the
echo min_power > /sys/class/scsi_host/host*/link_power_management_policy
- mount filesystem using relatime (default in Red Hat Enterprise Linux 6):
mount -o remount,relatime mountpoint
- activate best power saving mode for hard drives (part of the
hdparm -B 1 -S 200 /dev/sd*
- disable CD-ROM polling (part of the
hal-disable-polling --device /dev/scd*
- reduce screen brightness to
50or less, for example:
xbacklight -set 50
- activate DPMS for screen idle:
xset +dpms; xset dpms 0 0 300
- reduce Wi-Fi power levels (part of the
for i in /sys/bus/pci/devices/*/power_level ; do echo 5 > $i ; done
- deactivate Wi-Fi:
echo 1 > /sys/bus/pci/devices/*/rf_kill
- limit wired network to 100 Mbit/s (part of the
ethtool -s eth0 advertise 0x0F