From Fedora Project Wiki
m (internal link cleaning)
 
(29 intermediate revisions by 6 users not shown)
Line 9: Line 9:
* Marcela Maslanova <mmaslano@redhat.com> (system profile switcher)
* Marcela Maslanova <mmaslano@redhat.com> (system profile switcher)
* Petr Lautrbach <plautrba@redhat.com> (scomes, system profile switcher)
* Petr Lautrbach <plautrba@redhat.com> (scomes, system profile switcher)
* Jan Scotka <jsotka@redhat.com> (QA coverage)
* Jan Scotka <jscotka@redhat.com> (QA coverage)
* Karel Volny <kvolny@redhat.com> (QA coverage)
* Karel Volny <kvolny@redhat.com> (QA coverage)


== Current status ==
== Current status ==
* Targeted release: [[Releases/12|Fedora 12]]  
* Targeted release: [[Releases/12|Fedora 12]]  
* Last updated: 07/20/09
* Last updated: 2009-08-18
* Percentage of completion: 60%
* Percentage of completion: 100%


== Detailed Description ==
== Detailed Description ==
Line 32: Line 32:
** Network IO
** Network IO
* Extend tuned
* Extend tuned
** Integration of ktune and tuned: Static vs. dynamic tuning parts + performance vs. power tuning options
** Integration of ktune and tuned: Static vs. dynamic tuning parts + performance vs. power tuning options [100% DONE (scheduled for more tests during testday Oct 22)]
** New monitoring and tuning plugin for CPUs (using PM-QOS for CPUs) [100% DONE]
** New monitoring and tuning plugin for CPUs (using PM-QOS for CPUs) [100% DONE]
** New disk tuning algorithm for a more gradual tuning [50% DONE]
** New disk tuning algorithm for a more gradual tuning [100% DONE (scheduled for more tests during testday Oct 22)]
* System tuning configuration and profiles [75% DONE]
* System tuning configuration and profiles [100% DONE (scheduled for more tests during testday Oct 22)]
** Introduce new CLI to allow switching between various predefined settings
** Introduce new CLI to allow switching between various predefined settings
** Allow creating / editing / deleting profiles
** Allow creating / editing / deleting profiles
* New tool to measure improvements to system configuration changes or application changes: http://fedoraproject.org/wiki/Features/PowerManagement/scomes [100% DONE]
* New tool to measure improvements to system configuration changes or application changes: http://fedoraproject.org/wiki/Features/PowerManagement/scomes [100% DONE]


== Test Plan ==
== Tests & Test Day ==


To be defined.
We prepare Fedora test day on the 22nd of October 2009. There we want to give users the chance to test all the the new features coming in Fedora 12. The results will be compared with previous test day that took place in April 2009.


=== For power measurement ===
[[Test_Day:2009-10-22|Test Day 2009-10-22]]
# Default installation of a specific release to test
# Run several workload tests:
## Not logged in, gdm
## Logged in, start Firefox, Thunderbird and Openoffice
## Run a httpd server on it with a fixed index.html (http://pknirsch.fedorapeople.org/PM/index.html) and run the following script from a separate machine:
for i in `seq 59 -2 0`; do ab -t $((60-$i)) -c 32 http://myhost/index.html; sleep $i; done > result.txt
 
# For each workload run the following script on the test machine (1):
for i in `seq 31`; do date; powertop -d -t 60; done > restult.txt
 
# Alternatively you can use the latest version of DeviceKit-power and run the following:
for i in `seq 31`; do date; devkit-power --wakeups; done > restult.txt
 
=== For monitoring application behaviour ===
# Default installation of a specific release to test
# Run on of the following tools/scripts:
## Powertop or the latest gnome-power-manager to identify application wakeups
## netdevstat.stp to identify applications network behaviour (2)
## diskdevstat.stp to identify applications disk behaviour (2)
 
(1) In order to be able to see the actual power usage of the test machine you need to have some form of power measurement equipment. This can be either an external wattmeter or you can use a laptop as testmachine and run the tests on battery power.
 
(2) Both can be found in the contrib/ directory of the tuned git repo: https://fedorahosted.org/tuned/ which can be cloned using git clone ssh://git.fedorahosted.org/git/tuned.git/
 
=== Functionality test ===
 
* For "Write a monitoring and tuning daemon that adapts system settings to the current use"
** yum install tuned
** service tuned start
** cpu, disk and net devices should adapt to usage


== User Experience ==
== User Experience ==
Line 80: Line 50:


== Dependencies ==
== Dependencies ==
None so far
tuned base package now requires kobo for the tuned-adm tool.


== Contingency Plan ==
== Contingency Plan ==
Make sure none of the more aggressive power saving features breaks on common hardware and back it out in case it does.
 
Need to make sure to test the more aggressive power saving features if they break on common hardware and back it out in case they do or make some form of black/whitelist for know cases.


== Documentation ==
== Documentation ==
=== Scomes ===
is a new systemtap script that can be used to measure the effectiveness of system configuration changes and/or code changes to applications. [[Features/PowerManagement/scomes|scomes]]


=== Simple user tips for improving power usage ===
=== tuned-adm ===
* Use a properly dimensioned system for the job (no need for overpowered systems for simple Desktop use e.g.)
is command-line utility for setting up profiles.  
* For servers consolidate services on fewer systems to maximize efficiency of each system
[[SIGs/PowerManagement/UserDocumentation|documentation]]
* 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:
** usbcore.autosuspend=5
* 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
 
=== Simple programmer tips for improving power usage ===
* Wake up only when necessary
* Do not poll in programs or use short regular timeouts, rather react to events
* If you wake up, do everything at once (race to idle)
* Use large buffers to avoid frequent disk access. Write one large block at a time
* Don't use [f]sync() if not necessary
* Group timers across applications if possible (even systems)
* After using lots of malloc() and free() calls run malloc_trim(0) once (unportable)


=== Bugzillas ===
=== Bugzillas ===
 
Tracker bugs:
* [https://bugzilla.redhat.com/show_bug.cgi?id=484668 Tracker bug for power management efforts]
* [https://bugzilla.redhat.com/show_bug.cgi?id=484668 Tracker bug for power management efforts]
** [https://bugzilla.redhat.com/show_bug.cgi?id=454582 Tracker bug for over-eager apps that won't let disks spin down]
** [https://bugzilla.redhat.com/show_bug.cgi?id=454582 Tracker bug for over-eager apps that won't let disks spin down]
Line 134: Line 73:
In order to allow users to monitor the behaviour of their systems and to improve power consumption in general, several improvements were done for Fedora 12:
In order to allow users to monitor the behaviour of their systems and to improve power consumption in general, several improvements were done for Fedora 12:


* Improved applications to reduce unnecessary disk and/or network activity
* Improved ''tuned'' service to dynamically adapt system settings to the current use
* Improved ''tuned'' service to dynamically adapt system settings to the current use
* New configuration  
* New static tuning service available called ktune as part of tuned
* New configuration switch commandline tool called tuned-adm, coming with several predefined but editable system setting profiles
* New systemtap tool called scomes to measure amount of system resources consumed by a program


Users of Fedora 12 should therefore see a reduction in power usage of their system.
Users of Fedora 12 should therefore see a reduction in power usage of their system.
Line 143: Line 83:


* See [[Talk:Features/PowerManagement]]
* See [[Talk:Features/PowerManagement]]
[[Category:FeaturePageIncomplete]]
[[Category:FeatureAcceptedF12]]

Latest revision as of 22:59, 17 September 2016

Power Management improvements for Fedora 12

Summary

Our goal is the improvement of power management especially in regard to userland. This project is based on measurement and statistic of power consumption mainly on laptops. We are trying to locate the main power greedy applications by measuring with new tools, which have been introduced in our project. For Fedora 12 the plan is to improve and extend the functionality of tuned, merge it with ktune from RHEL 5 and introduce a new and easy way to switch between various predefined and extendible tuning settings for your system.

Owner

  • Phil Knirsch <pknirsch@redhat.com> (Lead, tuned, monitoring, documentation)
  • Jiri Skala <jskala@redhat.com>(BLTK packager, pm-utils maintainer)
  • Marcela Maslanova <mmaslano@redhat.com> (system profile switcher)
  • Petr Lautrbach <plautrba@redhat.com> (scomes, system profile switcher)
  • Jan Scotka <jscotka@redhat.com> (QA coverage)
  • Karel Volny <kvolny@redhat.com> (QA coverage)

Current status

  • Targeted release: Fedora 12
  • Last updated: 2009-08-18
  • Percentage of completion: 100%

Detailed Description

With Fedora 11 we introduce a new daemon called tuned. The goal now is to extend it's functionality and merge it with a tool we developed for Red Hat Enterprise Linux 5 called ktune as well as introduce a new and easy way to switch between various predefined and extendible tuning settings for your system.

Of course auditing wakeups and disk/network IO is still ongoing for Fedora 12 as well.

Benefit to Fedora

Simple: On average use less power for turned on machines while not affecting user experience (a lot ;)).

Scope

  • Review and fix behaviour of typical applications in a full installed Fedora in regard to: [IN PROGRESS]
    • CPU wakeups
    • Disk IO
    • Network IO
  • Extend tuned
    • Integration of ktune and tuned: Static vs. dynamic tuning parts + performance vs. power tuning options [100% DONE (scheduled for more tests during testday Oct 22)]
    • New monitoring and tuning plugin for CPUs (using PM-QOS for CPUs) [100% DONE]
    • New disk tuning algorithm for a more gradual tuning [100% DONE (scheduled for more tests during testday Oct 22)]
  • System tuning configuration and profiles [100% DONE (scheduled for more tests during testday Oct 22)]
    • Introduce new CLI to allow switching between various predefined settings
    • Allow creating / editing / deleting profiles
  • New tool to measure improvements to system configuration changes or application changes: http://fedoraproject.org/wiki/Features/PowerManagement/scomes [100% DONE]

Tests & Test Day

We prepare Fedora test day on the 22nd of October 2009. There we want to give users the chance to test all the the new features coming in Fedora 12. The results will be compared with previous test day that took place in April 2009.

Test Day 2009-10-22

User Experience

As power saving is not really visible without a measuring it the effects will not be directly visible. So in order to really see the effect you'll either need a laptop and run that on battery power or a wattmeter that is hooked between your system and the power line.

Dependencies

tuned base package now requires kobo for the tuned-adm tool.

Contingency Plan

Need to make sure to test the more aggressive power saving features if they break on common hardware and back it out in case they do or make some form of black/whitelist for know cases.

Documentation

Scomes

is a new systemtap script that can be used to measure the effectiveness of system configuration changes and/or code changes to applications. scomes

tuned-adm

is command-line utility for setting up profiles. documentation

Bugzillas

Tracker bugs:

Release Notes

In order to allow users to monitor the behaviour of their systems and to improve power consumption in general, several improvements were done for Fedora 12:

  • Improved tuned service to dynamically adapt system settings to the current use
  • New static tuning service available called ktune as part of tuned
  • New configuration switch commandline tool called tuned-adm, coming with several predefined but editable system setting profiles
  • New systemtap tool called scomes to measure amount of system resources consumed by a program

Users of Fedora 12 should therefore see a reduction in power usage of their system.

Comments and Discussion