Power Management Guide
Total Page:16
File Type:pdf, Size:1020Kb
Red Hat Enterprise Linux 6 Power Management Guide Managing power consumption on Red Hat Enterprise Linux 6 Last Updated: 2017-10-20 Red Hat Enterprise Linux 6 Power Management Guide Managing power consumption on Red Hat Enterprise Linux 6 Jaroslav Skarvada Red Hat Developer Experience [email protected] Jana Heves Red Hat Customer Content Services Yoana Ruseva Red Hat Customer Content Services Jack Reed Red Hat Customer Content Services Rüdiger Landmann Red Hat Customer Content Services Don Domingo Red Hat Customer Content Services Red Hat Inc. Edited by Marie Doleželová Red Hat Customer Content Services [email protected] Legal Notice Copyright © 2016 Red Hat, Inc. This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed. Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries. Linux ® is the registered trademark of Linus Torvalds in the United States and other countries. Java ® is a registered trademark of Oracle and/or its affiliates. XFS ® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries. MySQL ® is a registered trademark of MySQL AB in the United States, the European Union and other countries. Node.js ® is an official trademark of Joyent. Red Hat Software Collections is not formally related to or endorsed by the official Joyent Node.js open source or commercial project. The OpenStack ® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community. All other trademarks are the property of their respective owners. Abstract This document explains how to manage power consumption on Red Hat Enterprise Linux 6 systems effectively. The following sections discuss different techniques that lower power consumption (for both server and laptop), and how each technique affects the overall performance of your system. Table of Contents Table of Contents .C .H . A. P. T. .E . R. 1. .. O. .V . E. .R . V. .I E. .W . .3 . 1.1. IMPORTANCE OF POWER MANAGEMENT 3 1.2. POWER MANAGEMENT BASICS 4 .C .H . A. P. T. .E . R. 2. P. .O . .W . E. .R . .M . A. N. .A . G. .E . M. .E . N. .T . .A . U. .D . I.T . I.N . .G . A. N. .D . .A . N. .A . L. .Y . S. I. S. .6 . 2.1. AUDIT AND ANALYSIS OVERVIEW 6 2.2. POWERTOP 6 2.3. DISKDEVSTAT AND NETDEVSTAT 9 2.4. BATTERY LIFE TOOL KIT 11 2.5. TUNED AND KTUNE 13 2.5.1. The tuned.conf file 14 2.5.2. Tuned-adm 16 2.6. DEVICEKIT-POWER AND DEVKIT-POWER 19 2.7. GNOME POWER MANAGER 20 2.8. OTHER MEANS FOR AUDITING 20 .C .H . A. P. T. .E . R. 3. C. .O . R. .E . .I .N . F. R. .A . S. .T . R. .U . C. .T .U . R. .E . .A . N. .D . M. .E . C. .H . A. .N . I.C . S. 2. .2 . 3.1. CPU IDLE STATES 22 3.2. USING CPUFREQ GOVERNORS 22 3.2.1. CPUfreq Governor Types 23 3.2.2. CPUfreq Setup 24 3.2.3. Tuning CPUfreq Policy and Speed 25 3.3. CPU MONITORS 26 3.4. CPU POWER SAVING POLICIES 26 3.5. SUSPEND AND RESUME 27 3.6. TICKLESS KERNEL 27 3.7. ACTIVE-STATE POWER MANAGEMENT 27 3.8. AGGRESSIVE LINK POWER MANAGEMENT 28 3.9. RELATIME DRIVE ACCESS OPTIMIZATION 29 3.10. POWER CAPPING 29 3.11. ENHANCED GRAPHICS POWER MANAGEMENT 30 3.12. RFKILL 31 3.13. OPTIMIZATIONS IN USER SPACE 32 .C .H . A. P. T. .E . R. 4. .U . S. E. C. .A . S. .E . S. 3. .3 . 4.1. EXAMPLE — SERVER 33 4.2. EXAMPLE — LAPTOP 34 .A . P. .P .E . N. .D . I. X. A. .. .T .I .P . S. .F . O. .R . .D . E. .V . E. .L .O . P. .E . R. .S . 3. .6 . A.1. USING THREADS 36 A.2. WAKE-UPS 37 A.3. FSYNC 37 .A . P. .P .E . N. .D . I. X. B. .. .R . E. .V .I .S . I.O . N. H. .I .S .T . O. .R . Y. 3. .9 . 1 Power Management Guide 2 CHAPTER 1. OVERVIEW CHAPTER 1. OVERVIEW Power management has been one of our focus points for improvements for Red Hat Enterprise Linux 6. Limiting the power used by computer systems is one of the most important aspects of green IT (environmentally friendly computing), a set of considerations that also encompasses the use of recyclable materials, the environmental impact of hardware production, and environmental awareness in the design and deployment of systems. In this document, we provide guidance and information regarding power management of your systems running Red Hat Enterprise Linux 6. 1.1. IMPORTANCE OF POWER MANAGEMENT At the core of power management is an understanding of how to effectively optimize energy consumption of each system component. This entails studying the different tasks that your system performs, and configuring each component to ensure that its performance is just right for the job. The main motivator for power management is: reducing overall power consumption to save cost The proper use of power management results in: heat reduction for servers and computing centers reduced secondary costs, including cooling, space, cables, generators, and uninterruptible power supplies (UPS) extended battery life for laptops lower carbon dioxide output meeting government regulations or legal requirements regarding Green IT, for example Energy Star meeting company guidelines for new systems As a rule, lowering the power consumption of a specific component (or of the system as a whole) will lead to lower heat and naturally, performance. As such, you should thoroughly study and test the decrease in performance afforded by any configurations you make, especially for mission-critical systems. By studying the different tasks that your system performs, and configuring each component to ensure that its performance is just sufficient for the job, you can save energy, generate less heat, and optimize battery life for laptops. Many of the principles for analysis and tuning of a system in regard to power consumption are similar to those for performance tuning. To some degree, power management and performance tuning are opposite approaches to system configuration, because systems are usually optimized either towards performance or power. This manual describes the tools that Red Hat provides and the techniques we have developed to help you in this process. Red Hat Enterprise Linux 6 already comes with a lot of new power management features that are enabled by default. They were all selectively chosen to not impact the performance of a typical server or desktop use case. However, for very specific use cases where maximum throughput, lowest latency, or highest CPU performance is absolutely required, a review of those defaults might be necessary. To decide whether you should optimize your machines using the techniques described in this document, ask yourself a few questions: 3 Power Management Guide Q: Must I optimize? A: The importance of power optimization depends on whether your company has guidelines that need to be followed or if there are any regulations that you have to fulfill. Q: How much do I need to optimize? A: Several of the techniques we present do not require you to go through the whole process of auditing and analyzing your machine in detail but instead offer a set of general optimizations that typically improve power usage. Those will of course typically not be as good as a manually audited and optimized system, but provide a good compromise. Q: Will optimization reduce system performance to an unacceptable level? A: Most of the techniques described in this document impact the performance of your system noticeably. If you choose to implement power management beyond the defaults already in place in Red Hat Enterprise Linux 6, you should monitor the performance of the system after power optimization and decide if the performance loss is acceptable. Q: Will the time and resources spent to optimize the system outweigh the gains achieved? A: Optimizing a single system manually following the whole process is typically not worth it as the time and cost spent doing so is far higher than the typical benefit you would get over the lifetime of a single machine. On the other hand if you for example roll out 10000 desktop systems to your offices all using the same configuration and setup then creating one optimized setup and applying that to all 10000 machines is most likely a good idea. The following sections will explain how optimal hardware performance benefits your system in terms of energy consumption. 1.2. POWER MANAGEMENT BASICS Effective power management is built on the following principles: An idle CPU should only wake up when needed The Red Hat Enterprise Linux 5 kernel used a periodic timer for each CPU. This timer prevents the CPU from truly going idle, as it requires the CPU to process each timer event (which would happen every few milliseconds, depending on the setting), regardless of whether any process was running or not.