You are on page 1of 5

9/5/2014 PowerManagement/ReducedPower - Community Help Wiki

https://help.ubuntu.com/community/PowerManagement/ReducedPower 1/5
Contents
1. Introduction
2. PowerTOPTunables
3. Measuretemperaturevialmsensors
4. Usinglesspowerwithpmpowersave
1. Anexamplepower.dhook
2. Debuggingpmpowersave
5. Usinglesspowerwithlaptopmodetools
1. lmprofiler
6. CPUgovernor
7. thermald
8. Usinglessresourceintensivedesktop
environments
9. Dualandmultigraphicscardsetupsrunning
hotterthanWindows
1. Disableunusedgraphicscards
2. AMDFGLRXproprietarydriver
3. Radeonopensourcedriver
4. nouveauopensourcedriver
10. Increasefanspeed
1. DellInspironlaptops
2. fancontrol
11. PowerSavingTweaks
12. Generalmaintenance
13. RelatedLinks
Partners
Support
Community
Ubuntu.com
Logintoedit
Search
PowerManagement/ReducedPower
Introduction
Therearemanywaystoreducepowerconsumptionandextendbattery
lifeinUbuntu.Bydefault,mostofthesearenotenabledbecausethey
areunreliable.Withalittleexperimentation,youcangetyourpower
consumptiondowntoaminimum.
PowerTOPTunables
Beforeyoustartmakinganychanges,itisagoodideatofirstgeta
baselineforwhatyourcurrentpowerconsumptionis:
sudo aptitude install powertop
sudo powertop
Youmustberunningonbatterypowerforpowertoptogetthe
machine'scurrentwattusage.
Then,OnemaytabovertotheTunablessectiontoadjustthepower
managementsettingforeachiteminthelist.
Measuretemperaturevialm
sensors
Onehelpfultoolistomonitortheinternalhardwaretemperaturesvia
lmsensors.Formoreonthis,pleaseseehere.Pleasebemindfulthat
takingtemperaturereadingstoooftencouldalsocauseyourtemperaturetoincrease.Hence,it'sbesttousethelongest
timeintervalforyourintendeduse.
Usinglesspowerwithpmpowersave
Thepm-utilspackagecomeswithscriptsformanaginglowpowermodes.
sudo aptitude install pm-utils
Inordertoenterlowpowermode,runthis:
sudo pm-powersave true
Inordertoleavelowpowermode,runthis:
sudo pm-powersave false
Thesecommandswillrunthehooksin/etc/pm/power.dand/usr/lib/pm-utils/power.d,passingthe
argumenttruewhenenteringpowersaveandfalsewhenleaving.
Whenyourunpmpowersaveitcombinesthescriptsinthesetwodirectoriesandexecutestheminsortedorder.Ifboth
directoriescontainascriptwiththesamename,theonein/etc/pm/power.d/hasahigherprecedenceandonlythis
onewillbeexecuted.
9/5/2014 PowerManagement/ReducedPower - Community Help Wiki
https://help.ubuntu.com/community/PowerManagement/ReducedPower 2/5
Thereforetodisableascriptfrom/usr/lib/pm-utils/power.d/simplycreateanemptyfilein
/etc/pm/power.d/withthesamenameandwithouttheexecutebitset.
Anexamplepower.dhook
#
# A script to agressively toggle power management between high performance and very low power usage.
# For more information on each of these options, see http://www.lesswatts.org
#
# To install:
#
# sudo install 99-savings /etc/pm/sleep.d
# sudo install 99-savings /etc/pm/power.d
#
##
## POWER SAVE OFF
##
ac_power()
{
##
## DISK and FILESYSTEMS
##
# Set the drive to mostly stay awake. Some may want to change -B 200
# to -B 255 to avoid accumulating Load_Cycle_Counts
# -S 240 => put in standby after 20 minutes idle
# -B 200 => do not permit spindown
# -M => not supported by my drive
hdparm -B 200 -S 240 /dev/sda
# Remount ext3/4 filesystems so the journal commit only happens every 60
# seconds. By default this is 5 but, I prefer to reduce the disk
# activity a bit.
mount -o remount,commit=60,atime /
# Turn off the laptop mode disk optimization
echo 0 > /proc/sys/vm/laptop_mode
# Set the SATA to max performance
echo max_performance > /sys/class/scsi_host/host0/link_power_management_policy
echo max_performance > /sys/class/scsi_host/host1/link_power_management_policy
##
## NETWORK
##
# set the wifi to no power savings.
iwconfig wlan0 power off
##
## CPU AND MEMORY
##
# Set kernel dirty page value back to default
echo 10 > /proc/sys/vm/dirty_ratio
echo 5 > /proc/sys/vm/dirty_background_ratio
# Only wakeup every 60 seconds to see if we need to write dirty pages
# By default this is every 5 seconds but, I prefer 60 to reduce disk
# activity.
echo 6000 > /proc/sys/vm/dirty_writeback_centisecs
# Make sure ondemand governor is set
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
##
## SOUND AND VIDEO
##
# Turn off sound card power savings
echo 0 > /sys/module/snd_hda_intel/parameters/power_save
# Enable the webcam driver
modprobe uvcvideo
}
##
## POWER SAVE ON
##
battery_power()
{
##
9/5/2014 PowerManagement/ReducedPower - Community Help Wiki
https://help.ubuntu.com/community/PowerManagement/ReducedPower 3/5
## DISK and FILESYSTEMS
##
# Set the disks to aggressively save power.
# Some might find these settings too aggressive. If so, change
# "-S 4" to something larger like -S 24 (two minutes) and -B 1 to -B 255.
# -S 4 => put in standby after 20 seconds idle
# -B 1 => highest degree of power savings
# -M => not supported by my drive
hdparm -B 1 -S 4 /dev/sda
# Change ext3/ext4 filesystem settings to reduce disk activity.
# noatime => disable updates to a file's access time when the file is read.
# commit=600 => Change the commit times to 10 minutes.
mount -o remount,noatime,commit=600 /
# Set laptop disk write mode
echo 5 > /proc/sys/vm/laptop_mode
# Set SATA to minimum power
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
echo min_power > /sys/class/scsi_host/host1/link_power_management_policy
##
## NETWORK
##
# set the wifi to power savings.
iwconfig wlan0 power on
##
## CPU AND MEMORY
##
# Make sure ondemand governor is set
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
# Reduce disk activity by waiting up to 10 minutes before doing writes
echo 90 > /proc/sys/vm/dirty_ratio
echo 1 > /proc/sys/vm/dirty_background_ratio
echo 60000 > /proc/sys/vm/dirty_writeback_centisecs
##
## SOUND AND VIDEO
##
# Set sound card power savings
echo 10 > /sys/module/snd_hda_intel/parameters/power_save
# Remove the webcam driver
modprobe -r uvcvideo
}
##
## APPLY SETTINGS
##
case "$1" in
false) ac_power ;;
true) battery_power ;;
esac
Debuggingpmpowersave
sudo tail -f /var/log/pm-powersave.log &
sudo pm-powersave true
Usinglesspowerwithlaptopmodetools
Itisconfusing:laptop_modeisastatethatthekernelmaybein,butlaptopmodetoolsisacollectionofscriptswhich
attempttoreducepowerconsumptionandallowsyoutotweakanumberofpowerrelatedsettingsusingasimple
configurationfile.
aptitude install laptop-mode-tools
Iflaptopmodetoolsispresent,pmutilswillnotmanagedisksettingsbutwillassumethatlaptopmodetoolsisgoingto
handleit(/usr/lib/pmutils/power.d/95hdparmapm).
However,pmutilswillnotautomaticallystartandstoplaptopmodetools.Todoso,weneedtocreateahookforpm
utils:
9/5/2014 PowerManagement/ReducedPower - Community Help Wiki
https://help.ubuntu.com/community/PowerManagement/ReducedPower 4/5
sudo touch /etc/pm/sleep.d/10-laptop-mode-tools
sudo chmod a+x /etc/pm/sleep.d/10-laptop-mode-tools
sudo gedit /etc/pm/sleep.d/10-laptop-mode-tools
case $1 in
hibernate)
/etc/init.d/laptop-mode stop
;;
suspend)
/etc/init.d/laptop-mode stop
;;
thaw)
/etc/init.d/laptop-mode start
;;
resume)
/etc/init.d/laptop-mode start
;;
*)
echo Something is not right.
;;
esac
lmprofiler
Recentversions(1.11andlater)oflaptopmodetoolsincludeanewtoollmprofiler.Itwillmonitoryoursystem'sdisk
usageandrunningnetworkservicesandsuggeststodisableunneededones.
CPUgovernor
OnemaygovernortheirCPUviathecpufreqselectorcommand,providedbythepackagegnomeapplets.Forexample,if
onehadadualcoreCPU,onecouldexecuteataterminal:
sudo cpufreq-selector --cpu=0 --governor=powersave && sudo cpufreq-selector --cpu=1 --governor=powersave
ThiswillchangeyourCPUsettingfromondemand,topowersave.Then,youcouldverifytheCPUgovernorstatusby
executingataterminal:
cpufreq-info
Thisisprovidedbythepackagecpufrequtils.
IfonewantedtohavealowerCPUfrequencypersistthroughreboots,andchoosewhichspeedtheCPUfrequencyruns
on,onemayeditthefile/etc/init.d/cpufrequtils.
thermald
InTrusty+,onemayutilizethermald.Formoreonthis,pleaseseehere.
Usinglessresourceintensivedesktopenvironments
WhileUnity,GNOME3,andKDEprovidesadesktopexperiencethatmaybepreferredbyothers,theycanbemore
resourceintensive.Hence,onemaywanttoswitchtoXubuntu,Lubuntu,orgnomeshell.
Dualandmultigraphicscardsetupsrunninghotterthan
Windows
Disableunusedgraphicscards
Ifoneisnotutilizingthediscretegraphicscardmuch,onewouldwanttodisablethecardintheBIOSifanavailable
option.
AMDFGLRXproprietarydriver
CertainAMDgraphicscardsmayhavebetterheatprofilesusingtheproprietaryAMDdriverfglrx,versusthedefault
opensourceones.TheUbunturepositoriesoffervariousversionsoftheproprietarydriversnotedhere.
Radeonopensourcedriver
9/5/2014 PowerManagement/ReducedPower - Community Help Wiki
https://help.ubuntu.com/community/PowerManagement/ReducedPower 5/5
Fortheradeondriver,onemayperform:
echo low | sudo tee /sys/class/drm/card0/device/power_profile
exit
Onemayverifythenewprofilevia:
cat /sys/class/drm/card0/device/power_profile
low
nouveauopensourcedriver
ForthosewithnvidiaOptimusenabledgraphicscardsutilizingthenouveaudriver,onemaywanttotestBumblebeetosee
ifthiswouldprovideadesiredimprovementintheheatprofile.
Increasefanspeed
DellInspironlaptops
ForDellInspironlaptops,onemayusei8kmontoincreasethefanspeed.Thisutilityisprovidedbythepackagei8kutils.
Forinstructionsonusingthis,pleaseseethemanpage.
fancontrol
Onemayinstallthepackagefancontrol.Thenexecuteataterminal:
sudo pwmconfig
PowerSavingTweaks
Formorepowersavingtweaks,pleaseseehttps://wiki.ubuntu.com/Kernel/PowerManagement/PowerSavingTweaks.
Generalmaintenance
Useacanofairtoregularlyblowoutthedustthatmayaccumulateinthecomputerexhaustarea,whichcancause
incorrectheatflow,andairblockages.Aswell,donotobstructtheexhaustareas.
RelatedLinks
http://en.opensuse.org/Powersaving
http://www.gentoo.org/doc/en/powermanagementguide.xmlGentooPowerManagementGuide
https://access.redhat.com/knowledge/docs/en
US/Red_Hat_Enterprise_Linux/6/html/Power_Management_Guide/index.html
PowerManagement/ReducedPower(lastedited2014060600:07:14bypenalvch@43.sub70196
5.myvzw.com[70.196.5.43]:penalvch)

You might also like