Software Energy-Efficiency: Resource Monitoring Tactics
In the software energy-efficiency context, Resource Monitoring involves the monitoring and classification of workloads in order to optimize energy performance [1]. The following sections describe various tools for this purpose.
The content of this article builds upon the software energy-efficiency Resource Monitoring category introduced in the first article of this series on software energy efficiency.
1) Application Energy Monitoring
Currently, the ability to monitor application power is currently in its early stages of development. One reason for this is that in order for the associated tools to be accurate, they need to support many variations of operating systems, CPUs, and external dependencies such as services and libraries. Some projects are as follows:
- PowerAPI — Contains various tools [4] for logging the energy consumption of the machine, program, and individual processes in devices with an Intel CPU.
- JoularJX [15] — Java-based agent for software power monitoring of Java methods and is compatible with Intel-based hardware. Available for Windows and Linux.
1.1) Cloud Energy Monitoring (cloud-specific)
Cloud providers have been able to provide robust energy tools because they exist in their own controlled and isolated infrastructure. Some of these tools are as follows.
1.1.1) Amazon Web Services (AWS)
Customer Carbon Footprint Tool [5] — Track, measure, review, and forecast the carbon emissions generated from your AWS usage. Available in the AWS Billing Console.
1.1.2) Microsoft Azure
Microsoft Emissions Impact Dashboard [6] — Measures Microsoft Cloud emissions and carbon-saving potential. Available for Microsoft 365 and Microsoft Azure.
1.1.3) Google Cloud Platform (GCP)
Carbon Footprint Tool [7] — Provides users information showing the gross carbon emissions associated with their Google Cloud Platform usage. Available in the Cloud Console.
1.1.4) Open Source
Cloud Carbon Footprint (GCF) tool [8] — calculates energy from a cloud provider’s usage data and then applies the power usage effectiveness of the cloud provider’s data centers and the carbon intensity of the data center region that is being used.
CodeCarbon tool [9] — Python package for tracking the carbon emissions produced by the cloud or personal computing resources used to execute the code. It also shows how the user can lessen emissions by optimizing their code or hosting their cloud infrastructure in geographical regions that use renewable energy sources.
1.1.5) Other
Climatiq [10] — Using a REST api, convert cloud CPU and memory usage, storage, and networking traffic to CO2e estimates for Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure.
1.2) Performance Tools & Energy To Performance Correlation
There are many tools to help analyze software performance, and time to completion is a basis for a software task’s energy use, but their use as an evaluator for energy optimization tactics should not be exclusive of tools that measure energy. This is because execution speed does not have a high
correlation with energy efficiency in some cases. For example, when this correlation is low, an algorithm will not be optimized to efficiently handle a particular data flow rate and pattern (ie intermittent or continuous) but will be configured to run in a way that performance will not be affected.
An example of this is a polling mechanism that runs at a poll rate that is high enough to have performance that equals an interrupt-driven equivalent implementation.
2) OS Power Monitoring
There are numerous power monitoring tools available for different operating systems. Some examples are as follows:
Linux
- powerTop [11]
- pTop
- powerStat [12]
Windows, MacOS
- Intel PowerGadget [13]
- PowerCFG (comes with Windows OS)
3) Hardware Energy Monitoring
Although it cannot be used in a cloud environment, using a hardware energy-monitoring device in other situations can be useful under the following circumstances:
- The application’s power utilization must make up the majority of its hardware capacity in order to be measurable when compared to the operating system’s power utilization. For example, applications running on small embedded or IoT devices with a small or no RTOS (real-time operating system).
- If the application runs in a virtual machine or container, make sure sure that only one instance is running on the hardware platform that is being measured.
- Intermittent hardware functionality such as variable cpu fans and battery charging must not exist or should be disabled if possible.
- OS cron jobs and daemons that will impact the energy measurements should be disabled if possible.
- If only a wattage measurement is available on the energy-monitoring device, then measuring the energy (E=Power*Time) use will require the manual collection of measurements over a period of time in order to calculate it.
- Manual sampling may produce an inaccurate power measurement because assumptions will need to be made for power-use over periods of time that exceed the sampling period. Full automation of data sampling and energy calculations over long periods of time and under a load that reflects common, long-term and consistent scenarios is ideal.
- The device’s energy reading should be WattHours (Wh) and needs to be accurate to at least two decimal places if sampling measurements for less than 10 minutes, and this duration will probably be the case when manually writing down measurements in the case where the hardware device has no logging support. A kWh reading is not useful for this purpose because it would require at least five decimal places of accuracy to be useful (offering >= 2 decimal places of Wh accuracy), and devices that only offer this energy reading usually only go to two decimal places.
- The energy reading should have a reset feature so that it can be cleared before starting an energy measurement.
3.1) Measuring Application Energy using a Hardware Power Monitor
To get a rough estimate of the application’s power usage, install a baseline OS image, remove its intermittent processes where possible, and then obtain the device’s energy utilization with the power monitoring device. At this point, install the application, get the energy again, and then subtract the baseline OS energy measurements from it.
Ideally, the power measurement device should contain an energy measurement in WattHours (Wh) and have an accuracy of at least two decimal places. If it shows only the current wattage, then calculate the energy (Energy=Power*Time) manually by first deciding how long and at what frequency to take measurements. For example, if taking one measurement every second for one minute, then calculate the average of the samples over that period of time and if the result is 10 watts, then the energy used during this time is 10 watt-minutes which is 0.17 Wh (10/60).
3.2) Hardware Power Monitoring Devices
The following hardware devices are reasonably priced and offer WattHour (Wh) energy measurements and data collection capabilities. Finding other devices is a work in progress.
Watts Up? Pro [14] (note: This product is discontinued by the manufacturer).
HOBO UX120–018 Plug Load Data Logger. For 120v/50hz (note: 240V/220V/50hz available?)
Conclusion
In this article, we explored resource monitoring tactics for software energy-efficiency. We discussed tools for application energy monitoring, cloud energy monitoring provided by major providers, performance tools’ correlation with energy efficiency, OS power monitoring tools, and hardware energy monitoring. By utilizing these tactics and tools, developers can optimize energy performance and reduce environmental impact.
Articles in this series
The following articles are part of this comprehensive series that explores the energy-efficiency tactics in software architecture and implementation. The first article shown below contains a diagram that is described in the remaining four articles.
- Software Energy-Efficiency: Architecture and Implementation Tactics
- Software Energy-Efficiency: Resource Allocation Tactics
- Software Energy-Efficiency: Resource Adaptation Tactics
- Software Energy-Efficiency: Code Optimization Tactics
- Software Energy-Efficiency: Resource Monitoring Tactics
References
[1]: Sophie Vos, Patricia Lago, Roberto Verdecchia, Ilja Heitlager. Architectural Tactics to Optimize Software for Energy Efficiency in the Public Cloud. 2022, 11 pages.
[2]: Green Software Foundation. Awesome Green Software — Green Software — Research, tools, code, libraries, and training for building applications that emit less carbon into our atmosphere. https://github.com/Green-Software-Foundation/awesome-green-software. accessed on 2022–07–07.
[3]: Hayri Acar. Software development methodology in a Green IT environment. Other [cs.OH]. Université de Lyon, 2017. English. ffNNT : 2017LYSE1256ff. fftel-01724069f. https://tel.archives-ouvertes.fr/tel-01724069/document. p37–50. accessed on 2022–07–07.
[4]: Aurelien Bourdon. PowerAPI. Spirals Research Group (University of Lille and Inria). https://abourdon.github.io/powerapi-akka/. accessed on 2022–06–25.
[5]: Amazon Web Services. Customer Carbon Footprint Tool.
https://aws.amazon.com/aws-cost-management/aws-customer-carbon-footprint-tool. accessed on 2022–06-25.
[6]: Microsoft. Emissions Impact Dashboard. https://www.microsoft.com/en-us/sustainability/emissions-impact-
dashboard. accessed on: 2022–06–21.
[42]: Google Cloud. Google Cloud Carbon Footprint Tool. https://cloud.google.com/carbon-footprint. accessed on: 2022–06–21.
[8]: Cloud Carbon Footprint. “Cloud Carbon Footprint — Free and Open Source — Cloud Carbon Emissions Measurement and Analysis Tool”, https://www.cloudcarbonfootprint.org. accessed on 2022–06–21.
[9]: CodeCarbon. https://codecarbon.io/. accessed on 2022–06–27.
[10]: Climatiq. Cloud Computing Carbon Emissions. https://www.climatiq.io/cloud-computing-carbon-emissions. accessed on 2022–06–27.
[11]: Arjan Van de Ven, fenrus/powertop. Github repository. https://01.org/powertop/. accessed on 2022–06–25.
[12]: Colin King. Powerstat computer power measuring tool. Last updated 2022–17–09. https://snapcraft.io/powerstat. accessed on 2022–06–25.
[13]: Intel. Intel Power Gadget. https://www.intel.com/content/www/us/en/developer/articles/tool/power-
gadget.html. accessed on 2022–07–05.
[14]: J. M. Hirst, J. R. Miller, B. A. Kaplan, and D. D. Reed, “Watts up? pro ac power meter for automated energy recording,” ed: Springer, 2013.
[15]: Adel Noureddine. JoularJX. GitLab. https://gitlab.com/joular/joularjx. accessed on 2022–07–07.