**2. Related work**

In 2011, a post appeared on the MSDN Blog<sup>2</sup> : it concerned the energy consumption measurement of internet browsers. Authors measured power consumption and battery life of

<sup>1</sup> *A computer benchmark is typically a computer program that performs a strictly defined set of operations (a workload) and returns some form of result (a metric) describing how the tested computer performed.* [11] In our benchmark the *workload* is a set of usage scenarios and the *metric* is the power consumption.

<sup>2</sup> Browser Power Consumption - Leading the Industry with IE 9, http://blogs.msdn.com/b/ie/archive/2011/ 03/28/browser-power-consumption-leading-the-industry-with-internet-explorer-9.aspx

a common laptop across six scenarios and different browsers. They allowed each scenario to run for 7 minutes and calculated the average power consumption over that duration. Authors ran *IE9*, *Firefox*, *Opera* and *Safari* for each scenario, maintaning a fixed running duration, and then they made a comparison of the obtained results. Notable differences arose regarding power consumption and laptop battery life. Namely, using IE9 the battery lasted 3:45 hours, while using Opera the battery ran out of power after 2:45 hours. Hence, software can impact on energy consumption, as we also found in our previous work [15], where we monitored three servers for a whole year, observing that one of them consumed up to 75% more when used for graphical operations.

2 Will-be-set-by-IN-TECH

The management of system components can be done either in hardware or software. When we buy a device and it is not programmable, we can not do anything to limit its energy consumption. The designers have already made choices in terms of selection of components and in terms of resource management. On the other hand, if a system can be programmed, choices made by developers will affect the management of energy the device consumes. Looking at embedded systems, all the responsibilities in terms of management of energy resources are dependent on the hardware management and on the firmware. Firmware optimizations have immediate effects that can be verified directly by measuring the current the device consumes. If we consider a general purpose device, the hardware and the operating system have an important role in global energy management, but it is not the only one. On this type of device is it possible to install a multitude of programs that will impact on the management of energy resources. For example, if a third party software uses a particular

peripheral incorrectly, it could increase its energy demand even when not needed.

for his device usage, and to save more power.

This chapter is organized as follows:

Energy-Aware issues.

became evident.

**2. Related work**

The underlying idea is that power consumption depends not only on hardware features, but also (and probably mostly) on software usage and software internal characteristics. For instance, a more complex software will require more CPU cycles, or a single long write operation on disk can be less power consuming rather than several small write operations. The energetic impact of software will also be analyzed in order to understand the effect of human behaviour on power consumption: for example we can check whether customized power management profiles are more efficient than default ones. Usually, if a person is aware of how much he is consuming, he is able to find his own solution that is the most appropriate

This chapter deals with the matter of finding relationships between software usage and power consumption. For this purpose, two experiments have been designed, consisting in running benchmarks1 on two common desktop machines, simulating some typical scenarios and then measuring the energy consumption in order to make some statistical analysis on results.

• in Section 2, we present some related works in literature dealing with Green Software and

• in Section 5 we discuss the results of the experiments in detail, exposing the facts that

In 2011, a post appeared on the MSDN Blog<sup>2</sup> : it concerned the energy consumption measurement of internet browsers. Authors measured power consumption and battery life of <sup>1</sup> *A computer benchmark is typically a computer program that performs a strictly defined set of operations (a workload) and returns some form of result (a metric) describing how the tested computer performed.* [11] In our benchmark the *workload* is a set of

<sup>2</sup> Browser Power Consumption - Leading the Industry with IE 9, http://blogs.msdn.com/b/ie/archive/2011/ 03/28/browser-power-consumption-leading-the-industry-with-internet-explorer-9.aspx

• Section 3 describes the experiment design process in all of its steps.

• in Section 6, we try to give some conclusions and present our future works.

• in Section 4 we present the results of the experiments.

usage scenarios and the *metric* is the power consumption.

Kansal et al. [8] presented a solution for VM power metering. Since measuring the power consumption of a Virtual Machine is very hard and not always possible, authors built power models to get power consumption at runtime. This approach was designed to operate with low runtime overhead. It also adapts to changes in workload characteristics and hardware configuration. Results showed 8% to 12% of additional savings in virtualized data centers. Another related work is PowerScope [6]: this tool uses statistical sampling to profile the energy usage of a computer system. Profiles are created both during the data collection stage and during the analysis stage. During the first stage, the tool samples both the power consumption and the system activity of the profiling computer and then generates an energy profile from this data without profiling overhead. During data collection, authors use a digital multimeter to sample the current drawn by the profiling computer through its external power input. After that, they modified Odyssey platform for mobile computing. When there is a mismatch between predicted demand and available energy, Odyssey notifies applications to adapt. This is one of the first examples of *Energy-Aware* software.

In 1995, the first attempts were made to profile the energy performance of a computer. Lorch [9] in his M.S. thesis explained that there are two aspects to consider while measuring the breakdown of power consumption on a portable computer: I) Measuring how much power is consumed by each component, II) Profiling how often each component is in each state.

Other works about profiling and measuring energy consumption are related to embedded systems. For instance, JouleTrack [12] runs each instruction or short sequences of instruction in a loop and measure the current/power consumption. The user can upload his C source code to a Web Server which compiles, links and executes it on an ARM simulator. Program outputs, assembly listing and the run-time statistics (like execution time, cycle counts etc.) are then available and passed as parameters to an engine which estimates the energy consumed and produces graphs of different energy variables. Results showed that the error of predictions was between 2% and 6%. The concept of energy-awareness is based upon a complete knowledge on how and where energy is consumed on a device. Carroll and Heiser [3] present a detailed analysis of power consumption in a mobile device, focusing on the hardware subsystems, through common and realistic usage scenarios. Results show that the GSM module and the display are the most power-consuming components: for example, a GSM phone call on OpenMoko Neo Freerunner, HTC Dream G1 and Google Nexus One consumes 1135 mW, 822 mW and 846 mW respectively.

Usually, an accurate power consumption analysis of mobile or embedded devices is component-based. However, instantaneous information about discharge current and remaining battery capacity is not always available, because most devices do not have built-in sensors to collect these data. PowerBooter [17] has been proposed as a technique to build a battery-based model automatically. Authors motivate this decision by considering that

#### 4 Will-be-set-by-IN-TECH 356 Energy Effi ciency – The Innovative Ways for Smart Energy, the Future Towards Modern Utilities Energy Efficiency in the ICT - Profiling Power Consumption in Desktop Computer Systems <sup>5</sup>

different mobile devices of the same category show different power consumption, and a specific power consumption model for each device is difficult to obtain. Thus, instead of using external metering instrumentation to detect power consumption, only the internal battery voltage sensor is used, which is found across many modern smartphones. Authors indicate that for a 10-second interval, the PowerBooter technique has an accuracy of about 4.1% within measured values.

Usage analysis is a crucial step to optimize the energy consumption: this task is even more necessary within data centers where the number of computers is large. In this field, Bein et al. [2] tried to improve the energy efficiency of data centers: they studied the cost of storing vast amounts of data on the servers in a data center and they proposed a cost measure together

Energy Effi ciency in the ICT - Pro ling Power Consumption in Desktop Computer Systems 357

The aim of this research is to assess the impact of software and its usage on power consumption in computer systems. The goal is defined through the Goal-Question-Metric (GQM) approach. [1]. This approach, applied to the experiment, led to the definition of the model presented in Table 1. The first research question investigates whether and how much software impacts power consumption. The second research question investigates whether a categorization of usage scenarios with respect to functionality is also valid for power consumption figures. The third research question tries to find a quantifiable relationship between power consumption and actual usage of the computer system, by selecting four

metrics relative to the main system resources (CPU, Disk, Memory and Network).

*Evaluate* software usage

**Question 1** Does software impact power consumption?

power consumption?

CPU Usage (percentage) Memory Usage (reads/writes) Disk Usage (reads/writes) Network Usage (Packets/sec) Consumed Power (Watts)

**Metric** Consumed Power (Watts)

**Metric** Consumed Power (Watts)

*with respect to* power consumption *from the viewpoint of* the System User *in the context of* Desktop applications

*for the purpose of* assessing its energetic impact

**Question 2** Is it possible to classify software usage scenarios basing upon

**Question 3** What is the relationship between usage and power consumption?

The following usage scenarios, described in detail, will provide the basis for the analysis. The scenarios have been designed trying to simulate common operations for a desktop user, and they provide benchmarks (see Section 1) for the different resources of the computer system. This way, we will obtain useful information on the relationship between resource usage and

with an algorithm that minimizes such cost.

**3.1. Goal description and research questions**

**3. Study design**

**Goal**

**Metrics**

**Table 1.** The GQM Model

**3.2. Usage scenarios**

power consumption.

From a software engineering point of view, most contributions are devoted in developing frameworks and tools for energy metering and profiling. The authors of PowerBooter also propose an on-line power estimation tool called PowerTutor [17]. It implements the PowerBooter model in order to profile power consumption of applications, basing upon their component usage. Another example, which makes use of external metering devices, is ANEPROF [4], which authors define as a real-measurement-based energy profiler able to reach function-level granularity. It is developed for Android OS-based devices, thus it is aimed at profiling Java applications. It is based on JVM event profiling, using software probes to record runtime events and system calls. Authors had to address several design issues, such as overhead control and proper time synchronization. Power consumption profiling is made through correlation of real-time power measurements done by an external DAQ, connected to a ARM Computer-on-Module running Android 2.0. Authors also provide profiling data of four popular applications (Android Browser, GMail, Facebook, Youtube). The accuracy of ANEPROF depends on the hardware meter used. Its CPU overhead is stated to be less than 5%. Finally, SEMO [5] is a smart energy monitoring system, developed for Android, which provides also application-level consumption monitoring. This system is composed of three components: an *inspector*, which monitors the information on the battery, warning users when the battery reaches a critical condition; a *recorder*, which basically logs the actual charge of the battery and the running applications, and an *analyzer*, which calculates the energy consumption rate for each application and ranks them according to it.

Another alternative for energy measurement is low-level power-analysis using instruction-level models [14]. These models provide accurate power estimates for small kernels of code. An example of this kind of model is presented in Equation 1 where [10] Energy is the total energy dissipation of the program.

$$Energy = \sum\_{i} (BC\_i) + \sum\_{i,j} (SC\_{i\nu j} N\_{i\nu j}) + \sum\_{k} (OC\_k) \tag{1}$$

The first part is the summation of the base energy cost of each instruction (*BCi* is the base energy cost and *Ni* is the number of times instruction *i* is executed). The second part accounts for the circuit state (*SCi*,*<sup>j</sup>* is the energy cost when instruction *i* is followed by during the program execution). The third part accounts for energy contribution *OCk* of other instruction effects such as stalls and cache misses during the program execution.

The study presented here is instead focused on the analysis of power consumption data, and it is designed to find out usage patterns of IT devices' energy consumption and to identify situations in which there is a waste of energy. Webber et al. [16] also collected data on devices, focusing on the after-hours power state of networked devices in office buildings: they showed that most of devices are left powered on during night, concluding that this is the first cause of energy waste.

Usage analysis is a crucial step to optimize the energy consumption: this task is even more necessary within data centers where the number of computers is large. In this field, Bein et al. [2] tried to improve the energy efficiency of data centers: they studied the cost of storing vast amounts of data on the servers in a data center and they proposed a cost measure together with an algorithm that minimizes such cost.
