Lecture 3 Energy consumption" Presented by: Ekhiotz Jon Vergara Real-time Systems Laboratory Department of Computer and Information Science (IDA) Linköping University Sweden 17 November 2015 This lecture ! Basic energy background ! Energy as a resource ! Energy proportionality ! Load consolidation " Case study ! Scaling down power consumption ! A brief look to energy management ! Application context matters 1 Electrical units Electrical units Current Resistance Potential difference Metric Unit Description Potential difference Difference of charges Unit Symbol Volt Description or voltage between two points Potential difference V ChargeElectric differencecharges CurrentVolt or Ampere or voltage between two points intensity movement rate Current Ampere I Movement of theopposition charge (flow)to Circuit Resistance Ohms current flow Resistance Ohm R Circuit opposition to current flow Storage of energy as Farad Capacitance Capacitance Farad C Storage of energy as electric field an electric field Metric S. Gibilisco, "Teach Yourself Electricity and Electronics", 4rt edition, McGraw-Hill Professional Publishing , 2006 January 18, 2012 S. Gibilisco, "Teach Yourself Electricity and Electronics", 4rt edition, McGraw-Hill Professional Publishing , 2006 January 18, 2012 4 2 Energy metrics Energy metrics Electrical energy is transformed in heat! Power = Voltage * Intensity Power = Voltage * Current Metric Unit Description Rate of energy Metric Power Unit Watt Symbol Description expenditure Power Energy Watt P Joule Powerofdissipated over per Amount energy consumed length of time unita of time (rate) E Power dissipated over a time period Energy Joule 1 Joule = 1 Watt * second = 1 Ws 3600 Joules = 1 Watt * hour = 1 Wh 1 Joule = 1 Watt * 1 second = 1 Ws January 18, ! 2012 3600 Joules = 1 Watt * 51 hour = 1 Wh ! 3 Energy metrics: Example SMS ! The cost of sending a SMS ! Energy is power over time: 2.23 Joules Average power: 0.2 Watts 1 0.8 Power (Watts) ! 0.6 0.4 0.2 0 0 2 4 6 Time (seconds) 4 8 10 12 This lecture ! Basic energy background ! Energy as a resource ! Energy proportionality ! Load consolidation " Case study ! Scaling down power consumption ! A brief look to energy management ! Application context matters 5 Is energy just another resource? ! Energy has a global system nature ! A system is composed by several components consuming concurrently Component Component Component Energy source ! Components have different management techniques " ! Energy consumption at component level is already complex Applications share the different components 6 Energy efficiency goals ! Optimise the resource consumption (avoid waste) ! Reduce energy consumption ! Prolong battery lifetime ! Reduce cooling requirements and noise ! Reduce operating costs 7 General sources of energy waste ! System design is full of complex tradeoffs " " " " ! General-purpose system Peak performance Worst-case tolerance Availability System functionality as independent modules " " Modularity and interaction System components designed separately ! CPU, network interface… 8 Images: http://openclipart.org/detail/3402/tachometer-by-digitalink-3402 http://openclipart.org/detail/120691/business-people-siluete---by-systemedic General-purpose solutions ! Good performance for a multitude of different applications " " " Union of maximum requirements of each application class E.g., smartphone vs. MP3 player Legacy solutions 9 Image under CC license by cdwaldi on Flickr http://openclipart.org/detail/14794/red_sledgehammer-by-halfhaggis http://openclipart.org/detail/184624/walnut-by-frankes-1846240 Peak performance and growth ! Overprovisioning to plan for the future " Ensure enough capacity Vs. 10 Images: http://openclipart.org/detail/182940/bus-2-mono-by-Jarno-182940 http://openclipart.org/detail/173172/people-hitchhiking-by-vlodco_zotov-173172 Design process structure ! Hardware and software separately ! Divided system functionality across components ! Layers Layer 3 " Local optimisations not optimal for global efficiency Layer 2 Layer 1 11 Energy efficiency at design stage ! Replacement with a more power-efficient alternative ! Holistic solutions " " Broad scope of the problem Cross-layer interaction ! Optimise energy efficiency for the common case ! Design only for required functionality and requirements Image from: https://openclipart.org/detail/201475/recipe-book-by-bnsonger47-201475 12 Energy efficiency at runtime ! Trade off some other metrics for energy ! Disable or scale down unused resources ! Combination of multiple tasks in a single energy event ! Spend someone's else power ! Spend power to save power 13 Key architectural elements of solutions ! Analysis tools to predict resource usage trends ! Energy awareness " ! Monitoring infrastructure Control algorithms and policies http://openclipart.org/detail/35353/tango-utilities-system-monitor-by-warszawianka http://openclipart.org/detail/160057/machine-control-blue-by-zxmon21 14 This lecture ! Basic energy background ! Energy as a resource ! Energy proportionality ! Load consolidation " Case study ! Scaling down power consumption ! A brief look to energy management ! Application context matters 15 Energy proportionality ! Def.: Power must be proportional to the utilisation A system must have: " " Wide dynamic power range Low base power ! " ! If the room is empty, turn off the lights Low-power active modes Most systems present low energy proportionality Proportional consumption High idle consumption Constant consumption Power consumption ! Utilisation L. A. Barroso and U. Hölzle, The Case for Energy-Proportional Computing, IEEE Computer, vol. 40. 2007 16 Match the utilisation ! Overconsumption of energy Constant consumption High idle consumption Proportional consumption Designed for the utilisation Power consumption ! Low energy proportionality Average utilisation ! Utilisation (%) L. A. Barroso and U. Hölzle, The Case for Energy-Proportional Computing, IEEE Computer, vol. 40. 2007 17 This lecture ! Basic energy background ! Energy as a resource ! Energy proportionality ! Load consolidation " Case study ! Scaling down power consumption ! A brief look to energy management ! Application context matters 18 Load consolidation ! Switching off the light is not enough! ! The efficiency of the strategy is increased by the interaction with “consolidation”: Group people in one room to switch off other rooms’ lights Systems usually work at low utilization, which means low efficiency ! Change the utilisation! Power consumption ! 19 Utilisation Consolidation in time Time Load Capacity Server 2 Load Capacity Time Server 2 Load Capacity Time 20 Consolidation Server 1 Time No Consolidation Server 1 Load Capacity Consolidation in time Time Load Capacity Server 2 Load Capacity Delay Server 2 Time Load Capacity Time 21 Consolidation Server 1 Time No Consolidation Server 1 Load Capacity Case study: Cellular traffic ! More consuming ! Energy consumption at component level is complex Example case: cellular transmission (3G) 3 main states: High 6 Mbps Medium 32 kbps Power consumption ! Low Utilisation State is controlled by the network operator (Data rate) 22 Power profile of sending 800 bytes High Inactivity timers and transition delays ! " T1 Overheads Medium Transmission T2 1.6 1.4 Low Power (Watt) 1.2 1 0.8 0.6 0.4 0.2 0 0 T1 Transition delay 1 2 3 4 5 Transition delay 6 7 8 T2 9 Time (seconds) 23 10 Transition delay 11 12 13 14 15 yp e k Sk Ta l G M W ha Packet size (bytes) 0 er 1500 Vi b 1000 er 500 50 ng 0 0 Communication energy se ! 100 Ki k 0.2 WhatsApp Messenger GTalk 150 es 0.4 200 pp Instant Messaging 0.6 250 ts A 0.8 Data sent (kilobytes) Empirical CDF of packet size 1 100 Energy (Joules) 80 More than twice 60 40 20 0 WhatsApp Kik Messenger Viber GTalk Skype E. J. Vergara, S. Andersson, and S. Nadjm-Tehrani, When Mice Consume Like Elephants: Instant Messaging Applications, e-Energy '14, ACM, 2014. 24 Intermittent transmissions are wasteful ! Example: Instant Messaging (Skype) Energy overhead > transmission energy Power (Watts) " 1.5 DCH! High 1 FACH! Medium 0.5 PCH! Low 0 0 5 10 15 20 25 30 35 40 25 30 35 40 Time (seconds) Data (bytes) 800 600 400 200 0 0 5 10 15 20 Time (seconds) 25 Power (Watts) Aggregate the traffic 1.5 ! ! 1 ! 0.5 Background data traffic scheduler Background Traffic Maximum time to wait (Tw) for each transmission 3G radio level information to schedule transmissions " Power (Watts) 0 0" 1.5 " RRC state information 20 buffer 40 60 80 100 120 RLC thresholds Time (seconds) Inactivity timers FACH Medium Low PCH 140 160 180 200 Shaped Traffic 1 High DCH DCH High Timer = 90 s FACH Medium 0.5 Low PCH 0 0 20 40 60 80 100 120 140 160 180 Time (seconds) Ekhiotz Jon Vergara and Simin Nadjm-Tehrani. (e-Energy '12). ACM. 2012 26 200 This lecture ! Basic energy background ! Energy as a resource ! Energy proportionality ! Load consolidation " Case study ! Scaling down power consumption ! A brief look to energy management ! Application context matters 27 Switch off or scale down? ! Component power management ! Different levels " " " ! Circuits Architecture Compiler and systems Applied to different hardware Matthew Garret. Powering Down, Communications of the ACM 51, 9 (September 2008), 42-46 28 Center image center under CC license by jpstanley on Flickr and right image under GPL license Example: Processor ! Does not run at 100% capacity all the time ! Architecture techniques " " " CPU dynamic frequency and voltage scaling Low power states Tickless kernel 29 Dynamic voltage and frequency scaling ! Dynamic adjustment of voltage/frequency " ! Trade off power dissipation / performance Decision level " System level (OS) ! ! " Program level ! ! " Idleness of the system drives decision Voltage/frequency scaled to eliminate idle periods Program behaviour drives decision E.g., scale down when program knows that has to wait Hardware level ! Exploits different timings of hardware components and system techniques 30 DVFS in Linux ! 5 governors to control the performance level of processors " " " Performance: highest frequency Powersave: lowest frequency Ondemand: periodically monitor the system User-space Increase when system load > threshold Decrease when system load < threshold Monitoring application ! ! " Conservative: ! " ondemand and adjust performance level conservatively Interactive: ! ! ! Periodic load-based estimation at user space Real-time kernel thread to adjust frequency Fast adjusting from idle DVFS module Kernel-space Sangwook Kim, Hwanju Kim, Jongwon Kim, Joonwon Lee, and Euiseong Seo. 2013. Empirical analysis of power management schemes for multi-core smartphones. ICUIMC '13 31 This lecture ! Basic energy background ! Energy as a resource ! Energy proportionality ! Load consolidation " Case study ! Scaling down power consumption ! A brief look to energy management ! Application context matters 32 Energy management ! Planning and operating the energy resource " ! Optimise the resource consumption (avoid waste) Dimensions: " System components (e.g., CPU, memory or wireless interface) Power management of components (DVFS, radio resource allocation) " Entities sharing system components (e.g., applications) Allocate energy to software (tasks) to run App 1 App 2 App 3 App 4 OS Component Component Energy source 33 Component Is energy management easy? ! Energy has a global system nature " ! Hard to manage! Two common alternatives: " Best effort - trust on entities " Energy budgeting 34 Energy accounting ! Quantify, analyse and report the energy consumption of entities/activities in the system ! Applications of energy accounting: " " " Evaluate energy efficiency Transparency # energy awareness Efficient energy management ! Quantify energy consumption from the components ✓ ! Prescribe it to system entities/activities ? " Cost allocation is a hard problem without a best solution 35 Energy accounting – example Power% Timeout%energy% Ac1on% An%example%system% High%power% Energy%consumed%by%en1ty%1%in%isola1on% Ac1ve% Power% Time% Energy%consumed%by%en1ty%2%in%isola1on% Transi1on% delay% Timeout% Power% Time% The%total%actual%energy%consump1on% Low%power% Time% En#ty&1& ?" ?" .&.&.&.&.&.&.&.&.& Inac1ve% En#ty&2& How should we divide the total energy consumption? E(N):&Total&energy&consump#on& 36 This lecture ! Basic energy background ! Energy as a resource ! Energy proportionality ! Load consolidation " Case study ! Scaling down power consumption ! A brief look to energy management ! Application context matters 37 Context matters ! ! Application needs to be considered Wireless Sensor Networks " " ! Body Area Network (Healthcare) Cattle monitoring Application requirements " " " " " Scalability Coverage Real-time delay Quality of service Handling Mobility T. Rault et al. Energy efficiency in wireless sensor networks: A top-down survey. Computer Networks, Elsevier. 2014 38 Analysing energy-efficient mechanisms ! Energy-efficient mechanisms " Data reduction ! ! " Sleep/wakeup schemes ! ! ! Aggregation Compression Duty-cycling Topology control Application requirements " " " " " Scalability Coverage Real-time delay Quality of service Handling Mobility T. Rault et al. Energy efficiency in wireless sensor networks: A top-down survey. Computer Networks, Elsevier. 2014 39 Final remarks ! Energy is a vital resource ! Energy has a global system nature " The resource of the resources " Hard to manage ! Energy proportionality is desired ! Energy-efficient mechanisms " Avoid waste – Energy-efficient recipes " But focus on the requirements! 40 Reading guidelines ! P. Ranganathan. Recipe for efficiency: principles of power-aware computing. Communications of the ACM 53, 4 (April 2010), 60-67. ! Optional " " L. A. Barroso and U. Hölzle, The Case for Energy-Proportional Computing, IEEE Computer, vol. 40. 2007 T.Rault, A. Bouabdallah, Y. Challal, Energy efficiency in wireless sensor networks: A top-down survey, Computer Networks, Volume 67, 4 July 2014, Pages 104-122, ISSN 1389-1286, http://dx.doi.org/ 10.1016/j.comnet.2014.03.027. 41