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+
on the GNOME desktop, + + + 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-powersave
profile 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
ondemand
governor (enabled by default in Red Hat Enterprise Linux 6) - enable laptop mode (part of the
laptop-battery-powersave
profile):Copy to Clipboard Copied! Toggle word wrap Toggle overflow echo 5 > /proc/sys/vm/laptop_mode
echo 5 > /proc/sys/vm/laptop_mode
- increase flush time to disk (part of the
laptop-battery-powersave
profile):Copy to Clipboard Copied! Toggle word wrap Toggle overflow echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
- disable nmi watchdog (part of the
laptop-battery-powersave
profile):Copy to Clipboard Copied! Toggle word wrap Toggle overflow echo 0 > /proc/sys/kernel/nmi_watchdog
echo 0 > /proc/sys/kernel/nmi_watchdog
- enable AC97 audio power-saving (enabled by default in Red Hat Enterprise Linux 6):
Copy to Clipboard Copied! Toggle word wrap Toggle overflow echo Y > /sys/module/snd_ac97_codec/parameters/power_save
echo Y > /sys/module/snd_ac97_codec/parameters/power_save
- enable multi-core power-saving (part of the
laptop-battery-powersave
profile):Copy to Clipboard Copied! Toggle word wrap Toggle overflow echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
- enable USB auto-suspend:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done
for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done
Note that USB auto-suspend does not work correctly with all USB devices. - enable minimum power setting for ALPM (part of the
laptop-battery-powersave
profile):Copy to Clipboard Copied! Toggle word wrap Toggle overflow echo min_power > /sys/class/scsi_host/host*/link_power_management_policy
echo min_power > /sys/class/scsi_host/host*/link_power_management_policy
- mount filesystem using relatime (default in Red Hat Enterprise Linux 6):
Copy to Clipboard Copied! Toggle word wrap Toggle overflow mount -o remount,relatime mountpoint
mount -o remount,relatime mountpoint
- activate best power saving mode for hard drives (part of the
laptop-battery-powersave
profile):Copy to Clipboard Copied! Toggle word wrap Toggle overflow hdparm -B 1 -S 200 /dev/sd*
hdparm -B 1 -S 200 /dev/sd*
- disable CD-ROM polling (part of the
laptop-battery-powersave
profile):Copy to Clipboard Copied! Toggle word wrap Toggle overflow hal-disable-polling --device /dev/scd*
hal-disable-polling --device /dev/scd*
- reduce screen brightness to
50
or less, for example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow xbacklight -set 50
xbacklight -set 50
- activate DPMS for screen idle:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow xset +dpms; xset dpms 0 0 300
xset +dpms; xset dpms 0 0 300
- reduce Wi-Fi power levels (part of the
laptop-battery-powersave
profile):Copy to Clipboard Copied! Toggle word wrap Toggle overflow for i in /sys/bus/pci/devices/*/power_level ; do echo 5 > $i ; done
for i in /sys/bus/pci/devices/*/power_level ; do echo 5 > $i ; done
- deactivate Wi-Fi:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow echo 1 > /sys/bus/pci/devices/*/rf_kill
echo 1 > /sys/bus/pci/devices/*/rf_kill
- limit wired network to 100 Mbit/s (part of the
laptop-battery-powersave
profile):Copy to Clipboard Copied! Toggle word wrap Toggle overflow ethtool -s eth0 advertise 0x0F
ethtool -s eth0 advertise 0x0F