Full text
M´ ASTER DE AUTOM ´ ATICA E INFORM ´ ATICA INDUSTRIAL Trabajo de Fin de M´ aster ENERGY EFFICIENCY IN DATA CENTERS Autor: Dr. Jordi Arjona Aroca Director: Dr. Jose Enrique Sim´ o Ten Valencia, 17 de Diciembre de 2015
2
Trabajo fin de M´ aster ENERGY EFFICIENCY IN DATA CENTERS Autor: Dr. Jordi Arjona Aroca Director: Dr. Jose Enrique Sim´ o Ten Firma del tribunal calificador: Presidente: Vocal: Secretario: Calificaci´ on: Valencia, de de
Alea iacta est JULIUS CAESAR, before crossing the Rubicon
Abstract With the rise of cloud computing, data centers have been called to play a main role in the Internet scenario nowadays. Despite this relevance, they are probably far from their zenith yet due to the ever increasing demand of contents to be stored in and distributed by the cloud, the need of computing power or the larger and larger amounts of data being analyzed by top companies such as Google, Microsoft or Amazon. However, everything is not always a bed of roses. Having a data center entails two major issues: they are terribly expensive to build, and they consume huge amounts of power being, therefore, terribly expensive to maintain. For this reason, increasing the energy efficiency (and hence reducing the carbon footprint) of data centers has been one of the hottest research topics during the last years. In this master thesis we propose different techniques that can have an impact in the maintenance costs of data centers of any size, from small scale to large flagship data centers. We target energy efficiency in data centers as the main target of this master thesis. We first make a characterizing the power requirements of a data center server given that, in order to properly increase the energy efficiency of a data center, we first need to understand how energy is being consumed. We present an exhaustive empirical characterization of the power requirements of multiple components of data center servers, namely, the CPU, the disks, and the network card. To do so, we devise different experiments to stress these components, taking into account the multiple available frequencies as well as the fact that we are working with multicore servers. In these experiments, we measure their energy consumption and identify their optimal operational points. Our study proves that the curve that defines the minimal power consumption of the CPU, as a function of the load in Active Cycles Per Second (ACPS), is neither concave nor purely convex. Moreover, it definitively has a superlinear dependence on the load. We also validate the accuracy of the model derived from our characterization by running different Hadoop applications in diverse scenarios obtaining an error below 4.1% on average. The second topic we study is the Virtual Machine Assignment problem (VMA), i.e., optimizing how virtual machines (VMs) are assigned to physical machines (PMs) in data centers. Our optimization target is to minimize the power consumed by all the PMs when considering that power consumption depends superlinearly on the load. We study four different VMA problems, depending on whether the number of PMs and their capacity are bounded or not. We study their complexity and perform an offline and online analysis of these problems. The online analysis is 7
8 complemented with simulations that show that the online algorithms we propose consume substantially less power than other state of the art assignment algorithms.
Table of Contents Abstract 7 Table of Contents 9 List of Tables 11 List of Figures 15 I Background 1 1 Introduction 3 1.1 Understanding and Reducing Energy Consumption in Data Centers . . . . . . . . 6 1.1.1 How Servers Use Power . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.1.2 Speed Scaling Based Techniques . . . . . . . . . . . . . . . . . . . . . . 7 1.1.3 Virtualization Based Techniques . . . . . . . . . . . . . . . . . . . . . . 9 1.2 Overview and Summary of Contributions . . . . . . . . . . . . . . . . . . . . . 10 1.3 Roadmap ...................................... 11 2 Related Work 13 2.1 Characterizing the Energy Consumption of Data Center Servers . . . . . . . . . 13 2.1.1 Background................................. 13 2.1.2 RelatedWork................................ 14 2.2 Power Aware Assignment of Virtual Machines to Physical Machines . . . . . . . 16 2.2.1 Background................................. 16 2.2.2 RelatedWork................................ 18 II Understanding and Reducing Energy Consumption in Data Centers 21 3 Analysis of the Energy Consumption of Data Center Servers 23 3.1 Overview ...................................... 23 3.2 Methodology .................................... 25 9
Part I Background 1
Chapter 1 Introduction Internet has revolutionized our world. In 15 years it has passed from being hardly found in any home to be hardly not found in any pocket. We have become Internet-addicts and got used to continuously check our emails, videos, photos,. . . Through Google, Facebook, Twitter, we learn about what is happening with our friends or in any remote corner of the world, we are able to contrast news, we have access to any kind of information we are curious about. At the same time, Internet has also overturned the business world, simplifying and reducing the costs of sharing information in and between companies, and allowing any company, no matter how small it is, to have customers all over the world. This has become real thanks to new concepts like the Internet of things, social networks, or cloud computing. However, at the end of the day, what Internet has done is putting huge amounts of data available to everyone. One of the keys of this availability of data has been the proliferation of data centers. Although some data centers are not necessarily large, like the ones usually deployed at many universities, companies or government institutions, large companies such as Google, Facebook, Amazon or Microsoft, among others, are building large scale data centers all over the world. A large scale data center can be defined, in a nutshell, as an integrated facility housing a large amount of high end servers, up to the order of tens of thousands, interconnected by a dense network, hosting petabytes of data and consuming up to various tens of mega Watts. According to Belady [22], the building costs of a data center is between $8M-$30M/MW, being the average around $20M/MW, depending on the kind of facility. These numbers lead to costs of $100−150M for small/mid size facilities, while huge data centers, like Facebook’s or Google’s, can be in the order of $600M. However, although building a data center is expensive, they can be even more expensive to maintain. As we noted above, their average power consumption can be around 20MW per year, which unveils a second problem, their energy consumption. In a recent study, Van Heddeghem et al. [55] estimate that, between 2005 and 2012, worldwide aggregated data center energy consumption increased almost a 50%, reaching 270TWh from the previous 200TWh. This is roughly a 3
4 Introduction Figure 1.1: Worldwide use phase electricity consumption of data centers from 2005 to 2012 and the total worldwide electricity use from 2008 to 2012. Data center consumption is shown as the aggregation of its main consumers, servers, storage, communication and infrastructure. 1.5% of the total worldwide electricity consumption, and with a compound annual growth rate of a4.4%. Therefore, it is easy to see why greening data centers has emerged as one of the main targets of the research community during the last years. Greening data centers has, in fact, a two-fold objective, reducing operation costs, i.e., saving money; and improving data center sustainability, i.e., reducing the amount of energy consumption attributed to data centers. In the same way, efficiency of several data center components, for instance cooling systems, may lead to a reduction on the building costs. Data center research has become a broad field of research. Even when we restrain ourselves to reducing building cost or increasing energy efficiency, the complexity and variety of subsystems that can be found in a data center result in a huge amount of particular problems. Even if we restrain ourselves to the increasing the energy efficiency of the different data center subsystems topic, the body of related work is overwhelming. In fact, if we look at some data provided by Barroso et al. [18, 19] we can see how the research in the field has contributed to change the energy consumption breakdown of data centers. In Figure 1.2 we can find the energy consumption breakdowns of a legacy data center with a PUE1value of around 2.0in 2009 and 2013, in subfigures 1.2(a) and 1.2(b) respectively. Similarly, in subfigures 1.2(c) and 1.2(d), we can also see the evolution on the distribution of peak power usage in a hardware subsystem in a Google’s data 1PUE responds to Power Usage Efficiency and it is one of the most commons and broadly accepted efficiency metrics. It measures the amount of cooling power needed versus the amount of electricity to run the IT infrastructure. An ideal ratio is 1.0.
5 23% 30% 12% 33% 2% UPS/PDU IT Equipment CRAC Chiller Ancillary (a) Typical distribution of energy usage in a conventional datacenter with a PUE of 2.0 - 2009 10% 50% 12% 25% 3% UPS/PDU IT Equipment CRAC Chiller Ancillary (b) Typical distribution of energy usage in a conventional datacenter with a PUE of 2.0 - 2013 33% 30% 10% 5% 22% CPUs DRAM HDD Networking Other (c) Approximate distribution of peak power usage in a hardware subsystem in a Google’s data center in 2007. 42% 12% 14% 5% 4% 8% 15% CPUs DRAM HDD Networking Misc. Power Overhead Cooling Overhead (d) Approximate distribution of peak power usage in a hardware subsystem in a Google’s data center in 2012. Figure 1.2: Evolution of the breakdown of a data center energy consumption and a hardware system between 2007-2013. center between 2007 and 2012. This evolution is the result of intense research in multiple fields concerning each one of the pieces of hardware, usage policies or interaction between them. However, although this evolution on the power requirements can be extended to many data centers, as for instance the (each time more) energy proportional servers, they can not be applied to all of them. One of the variables that conditions the application of these latest techniques is, for instance, the size of the data center. Big companies proudly exhibit the very low PUEs of their flagship data centers, like Facebook’s PrineVille and Lule˚ a, with 1.06 −1.08 and 1.07 PUE, or Google’s Hamina, with 1.14 PUE. However, the resources which can be devoted to the design and construction of these data centers are not the same devoted to smaller ones or by smaller companies. Similarly, these low PUEs are usually achieved because of some particular aspects of the location of the data center, like the use of Finland’s gulf water in Hamina. According to the Uptime Institute [88], the average PUE is around 1.8−1.89, which gives a better idea of how much energy efficiency can still be improved. Moreover, although a bit outdated, Bayley et al. [13], in 2007, presented a study quantify-
6 Introduction Table 1.1: Classification of Data Center types according to their size. Server Closet Server Room Localized Data Center Mid-Tier Data Center Enterprise Class Data Center Size [sq ft] <200 <500 <1.000 <5.000 >5.000 # Servers (2005) 1.657.947 1.942.214 1.674.648 1.511.999 3.074.424 Estimated Energy consumption 11% 24% 21% 19% 24% # Servers (est. 2009) 2.135.538 3.057.834 2.107.592 1.869.595 3.604.678 ing the amount of servers in different facilities according to their size. Some of the results of that study are presented in Table 1.1, showing the different categories, the estimated number of servers per category in 2005 as well as the distribution of energy consumption among them, and a prediction of the evolution of these numbers for 2009. These numbers show how most of the energy consumed is not necessarily in large enterprise data centers, but in smaller environments in which, in most cases, the PUE does not match the ones achieved by Facebook’s or Google’s flagship data centers. Nevertheless, it is important to remark that industry has become aware of this problem and more and more solutions are being provided each day to companies that only need small sized data centers, like Modular or Containerized Data Centers [5, 94] or integrated box solutions like IBM’s Integrated Server Room [59]. In addition to this, Containerized Data Centers could even help to reduce the building costs of large data centers avoiding over built capacity and helping with over time scalability [89]. This master thesis is divided in two parts, a Background part, which includes this introduction and the state of the art of the two different, but related, problems we addressed in this document; and a second part, Understanding and Reducing Energy Consumption in Data Centers, that describes our work in both problems. This study intends to help to a better understanding of how energy is consumed in data centers as well as providing solutions which can be applied to data centers in any size range, from server closets to large enterprise data centers. We know provide some insights about what will be covered in this master thesis. 1.1 Understanding and Reducing Energy Consumption in Data Centers As we have already mentioned, improving the energy efficiency of data centers has become an issue of capital importance both for economic and of environmental reasons. Due to this importance, the amount of techniques that have been proposed to help in this area is so huge that it is impossible to present them in just one document. Hence, we now only introduce some of the techniques which are relevant for this master thesis. 1.1.1 How Servers Use Power Servers are like puzzles where each one of its pieces has its own share of power consumption. At the same time, the global power consumption of a each one of these pieces is not constant, it
1.1 Understanding and Reducing Energy Consumption in Data Centers 7 depends on the stress we introduce in each one of them. Depending on the amount of accesses we do to disk, to memory, on the amount of data we send to or receive from the network and on the amount of processing we do or the heat we generate, the power required by Hard Drives, Memory, Network, CPU or cooling units will vary. There are also more components, as we saw in Figure 1.2, but those are usually assumed to be the major contributors to the power consumption of data center servers. However, servers are not power proportional [17], i.e., the total power consumed is not proportional to the amount of load being processed, and usually, the main contributor to power consumption is the fact of having the machine switched on. In the recent past, the amount of power consumed by an idle machine compared to the power consumed when it worked at full speed could easily add up to a 70% of its total power consumption. If we focus in the last 7years, we can consult the available public data from the SPEC power benchmark web [38]. Comparing results from the last quarter of 2007 against the last available ones (second quarter of 2014), we can see a reduction on the power consumption of servers when idle compared to its peak consumption from barely a 60% in most servers to roughly a 20 −25% of power consumption. If we consider only the active range, i.e., the power variation between the idle state and the peak consumption, it has been traditionally assumed that most of the power is consumed by the CPU. Similarly to what happens with servers, processors do not consume power linearly, in proportion to the load. Although processor power consumption has usually been modeled in a linear fashion, everything changed with the arrival of multicore processors able to work at multiple frequencies. Multicore processors introduced multiple changes. First, cpus in the same processor are able to share on-chip and on-die resources, increasing,hence, the synergies and reducing power requirements [21]. Also, there are new parameters to be considered as variable voltages and frequencies that determine CPU speed and, therefore, power requirements. Due to this new complexity, being able to understand how servers consume power has become a must if we want to devise any technique or strategy that intends to reduce power or energy consumption. In this master thesis, we will present an empirical study were some of these aspects were analyzed and we were able to shed some light about the behavior of multicore and multifrequency machines based on real data. This knowledge can be applied in multiple techniques devoted to reduce the aggregated power and energy consumption of data centers. Not understanding the effect that placing a task in a server is going to have on its power consumption will result in non-optimal, in the best case, or in completely non-efficient, in the worst case, implementations of techniques such as speed scaling policies or virtualization strategies. We will now discuss about the latter two practices, speed scaling and virtualization, which are well known examples of techniques used to reduce the aggregated power and energy consumption in data centers. 1.1.2 Speed Scaling Based Techniques Speed scaling is based on the ability of a processor to change its operating voltage and speed (frequency), and hence the speed and power consumption of the server. It is important to note that
8 Introduction the values of voltage and frequency are not independent from one another. There is an intimate relation between them as, usually, the voltage conditions the range of available frequencies. In Table 1.2 we can find the different combinations of frequencies and voltages available for different processors. Table 1.2: Relation between frequency and voltage for different processors Processors AMD Opteron 6276 Intel Xeon W3530 Intel Xeon E5606 Voltages Frequencies Voltages Frequencies Voltages Frequencies 0.9375V to 1.3125V 1.4 GHz, 1.6 GHz, 1.8 GHz, 2.1 GHz, 2.3 GHz, 2.3 GHz 0.750V to 1.350V 1.596 GHz, 1.729 GHz, 1.862 GHz, 1.995 GHz, 2.128 GHz, 2.261 GHz, 2.394 GHz, 2.527 GHz, 2.666 GHz, 2.793 GHz, 2.794 GHz 0.800V to 1.375V 1.2GHz, 1.333 GHz, 1.467 GHz, 1.6 GHz, 1.733 GHz, 1.867 GHz, 2GHz, 2.133 GHz One well known and extended implementation of speed scaling is Dynamic Voltage and Frequency Scaling (DVFS) which can be usually be found in the ample majority of servers which can be found nowadays in the market. DVFS can be configured with different governors or operating policies which will condition the way frequency adapts to the load in the system. However, it is important to note that we can not just reduce the frequency as much as we want as it will affect the performance of the tasks being run in the machine. For this reason, usually, commercial implementations of DVFS have conservative policies whose main target is reduce operating frequency, and hence the consumption, of the machine when idle. Most of the research in this field is devoted to find efficient policies which allow to reduce power consumption or energy consumption. It is important to remark the difference between both targets, let us give an easy example. Assume that we have a task that needs a time Tto complete. If we reduce the operating frequency of the system, and hence the power consumption is reduced from Cto C0, it might happen that the task being run in our machine now needs a time T0to be run. If the total energy consumed T·Cis larger than T0·C0we will have reduced the power consumption during a period of time, but spent more energy. This is neither good nor bad, both policies have their applications in different scenarios. However, we must remember that it is not trivial to optimize the power required and it is needed to carefully design the policies to be used.
1.1 Understanding and Reducing Energy Consumption in Data Centers 9 1.1.3 Virtualization Based Techniques We have already mentioned two important aspects of modern servers: that, with almost no exception, they are multicore and multifrequency servers, and that we pay a high cost in terms of power, just for having them idle, (i.e., powered on but not doing any task). However, think now, just for a second, that, years ago, running multiple tasks in a machine was through multithreading, i.e., running them in parallel with no isolation. When a task required some isolation, for security or other reasons, it had to be run alone in a server, what implies that the server resources not being used by that task were wasted. Keep in mind also that, in old servers the percentage of power used just for having them powered on was larger than nowadays. Additionally, there were some problematic situations with multithreading, as the existence of resource-greedy users or tasks. In order to tackle this situation we use Virtualization. Although virtualization was originally developed in the 1960s by IBM, it was forgotten and then recovered again in the 1990s. We can define virtualization as “a technology that combines or divides computing resources to present one or many operating environments using methodologies like hardware and software partitioning or aggregation, partial or complete machine simulation, emulation, time-sharing, and many others” [35]. We call each one of these operating environments a Virtual Machine (VM). Hence, instead of running tasks in a per server basis or use multithreading sharing the resources pool, virtualization allows us to run tasks in a per VM basis, therefore running multiple tasks (with limited resources) independently in the same server. Nevertheless, virtualization only opened the door for future improvements in how to reduce the power consumption of data centers from a server perspective. Two of these consequences were consolidation and virtual machine allocation techniques. Consolidation is probably the most straightforward consequence of virtualization. Since we gained the ability of putting multiple virtual machines in one server it is logic trying to maximize the efficiency of servers. Consolidation aims to either maximize the aggregated number of tasks being run keeping a constant number of active servers, or minimize the number of servers needed to run a set of tasks. In both cases, the contribution of virtualization to increase the productivity and the energy efficiency of data centers is clear. Similarly, and intimately related with consolidation, we have virtual machine allocation techniques. Given that the assignment of virtual machines to servers is an NP-hard problem (it can be easily reduced to problems such as bin packing or 3-partition for instance, as we will see in Chapter 4), multiple heuristics and algorithms have been devised to tackle the online version of the problem. Algorithms like First Fit, Packing, Most (Least) Loaded First . . . try to obtain the best assignment of tasks to servers according to a certain magnitude, like cost, energy consumption. . . although in general try to minimize the number of active servers. However, most of these algorithms are based on linear models for the power consumption of cores. Based on the insights we got with the characterization of a data center server we will study the effect of assuming a non-linear power consumption model for data centers servers. Based on this model, we will perform a competitive analysis of different VM to physical machine
16 Related Work active cores. Our experiments and model support their findings and shed light on the nature of such effect. 2.2 Power Aware Assignment of Virtual Machines to Physical Machines 2.2.1 Background The current pace of technology developments, and the continuous change in business requirements, may rapidly yield a given proprietary computational platform obsolete, oversized, or insufficient. Thus, outsourcing has recently become a popular approach to obtain computational services without incurring in amortization costs. Furthermore, in order to attain flexibility, such service is usually virtualized, so that the user may tune the computational platform to its particular needs. Users of such service need not to be aware of the particular implementation, they only need to specify the virtual machine they want to use. This conceptual approach to outsourced computing has been termed cloud computing, in reference to the cloud symbol used as an abstraction of a complex infrastructure in system diagrams. Current examples of cloud computing providers include Amazon Web Services [1], Rackspace [4], and Citrix [2]. Depending on what the specific service provided is, the cloud computing model comes in different flavors, such as infrastructure as a service, platform as a service, storage as a service, etc. In each of these models, the user may choose specific parameters of the computational resources provided. For instance, processing power, memory size, communication bandwidth, etc. Thus, in a cloud-computing service platform, various virtual machines (VM) with user-defined specifications must be implemented by, or assigned to1, various physical machines (PM)2. Furthermore, such a platform must be scalable, allowing to add more PMs, should the business growth require such expansion. In this work, we call this problem the Virtual Machine Assignment (VMA) problem. The optimization criteria for VMA depends on what the particular objective function sought is. From the previous discussion, it can be seen that, underlying VMA, there is some form of bin-packing problem. However, in VMA the number of PMs (i.e., bins for bin packing) may be increased if needed. Since CPU is generally the dominant power consumer in a server, as shown in Figure 1.2 and as we will show in Chapter 3, VMA is usually carried out according to CPU workloads. With only the static power consumption of servers considered, previous work related to VMA has focused on minimizing the number of active PMs (cf. [23] and the references therein) in order to minimize the total static energy consumption. This is commonly known as VM consolidation [66, 79]. However, despite the static power, the dynamic power consumption of a 1The cloud-computing literature use instead the term placement. We choose here the term assignment for consistency with the literature on general assignment problems. 2We choose the notation VM and PM for simplicity and consistency, but notice that our study applies to any computational resource assignment problem, as long as the minimization function is the one modeled here.
2.2 Power Aware Assignment of Virtual Machines to Physical Machines 17 server, which has been shown to be superlinear on the load of a given computational resource [15, 53], is also significant and cannot be ignored. Since the definition of load is not precise, we use the definition we provide in Chapter 3 and define the load of a server as the amount of active cycles per second a task requires, an absolute metric independent of the operating frequency or the number of cores of a PM. The superlinearity property of the dynamic power consumption is also confirmed by the results that we show in Chapter 3. As a result, when taking into account both parts of power consumption, the use of extra PMs may be more efficient energy-wise than a minimum number of heavily-loaded PMs. This inconsistency with the literature in VM consolidation is supported by the results that will be presented in Chapter 3 and, hence, we claim that the way consolidation has been traditionally performed has to be reconsidered. In this work, we combine both power-consumption factors and explore the most energy-efficient way for VMA. That is, for some parameters α > 1and b > 0, we seek to minimize the sum of the αpowers of the PMs loads plus the fixed cost bof using each PM. Physical resources are physically constrained. A PMs infrastructure may be strictly constrained in the number of PMs or in the PMs CPU capacity. However, if usage patterns indicate that the PMs will always be loaded well below their capacity, it may be assumed that the capacity is unlimited. Likewise, if the power budget is very big, the number of PMs may be assumed unconstrained for all practical purposes. These cases yield 4 VMA subproblems, depending on whether the capacity and the number of PMs is limited or not. We introduce these parameters denoting the problem as (C,m)-VMA, where Cis the PM CPU capacity, mis the maximum number of PMs, and each of these parameters is replaced by a dot if unbounded. 2.2.1.1 Problem Definition We describe the (·,·)-VMA problem now for a better understanding of some of the works presented in the following related work section. Given a set S={s1, . . . , sm}of m > 1identical physical machines (PMs) of capacity C; rational numbers µ,αand b, where µ > 0,α > 1and b > 0; a set D={d1, . . . , dn}of nvirtual machines and a function `:D→Rthat gives the CPU load each virtual machine incurs3, we aim to obtain a partition π={A1, . . . , Am}of D, such that `(Ai)≤C, for all i. Our objective will be then minimizing the power consumption given by the function P(π) = X i∈[1,m]:Ai6=∅ µX dj∈Ai `(dj)α+b!.(2.1) Let us define the function f(·), such that f(x)=0if x= 0 and f(x) = µxα+botherwise. Then, the objective function is to minimize P(π) = Pm i=1 f(`(Ai)).The parameter µis used for consistency with the literature. 3For convenience, we overload the function `(·)to be applied over sets of virtual machines, so that for any set A⊆D, `(A) = Pdj∈A`(dj).
18 Related Work We also define several special cases of the VMA problem, namely (C, m)-VMA, (C, ·)-VMA, (·, m)-VMA and (·,·)-VMA. (C, m)-VMA refers to the case where both the number of available PMs and its capacity are fixed. (·,·)-VMA, where (·)denotes unboundedness, refers to the case where both the number of available PMs and its capacity are unbounded (i.e., Cis larger than the total load of the VMs that can ever be in the system at any time, or mis larger than the number of VMs that can ever be in the system at any time). (C, ·)-VMA and (·, m)-VMA are the cases where the number of available PMs and their capacity is unbounded, respectively. 2.2.2 Related Work To the best of our knowledge, previous work on VMA has been only experimental [34,71,74, 90] or has focused on different cost functions [7,23,32,37]. First, we provide an overview of previous theoretical work for related assignment problems (storage allocation, scheduling, network design, etc.). The cost functions considered in that work resemble or generalize the power cost function under consideration here. Secondly, we overview related experimental work. Chandra and Wong [32], and Cody and Coffman [37] study a problem for storage allocation that is a variant of (·, m)-VMA with b= 0 and α= 2. Hence, this problem tries to minimize the sum of the squares of the machine-load vector for a fixed number of machines. They study the offline version of the problem and provide algorithms with constant approximation ratio. A significant leap was taken by Alon et al. [7], since they present a PTAS for the problem of minimizing the Lpnorm of the load vector, for any p≥1. This problem has the previous one as special case, and is also a variant of the (·, m)-VMA problem when p=αand b= 0. Similarly, Alon et al. [8] extended this work for a more general set of functions, that include f(·)as defined above. Hence, their results can be directly applied in the (·, m)-VMA problem. Later, Epstein et al. [42] extended [8] further for the uniformly related machines case. We will use these results in Chapter 4 in the analysis of the offline case of (·, m)-VMA and (·,·)-VMA. Bansal, Chan, and Pruhs minimize arbitrary power functions for speed scaling in job scheduling [15]. The problem is to schedule the execution of ncomputational jobs on a single processor, whose speed may vary within a countable collection of intervals. Each job has a release time, a processing work to be done, a weight characterizing its importance, and its execution can be suspended and restarted later without penalty. A scheduler algorithm must specify, for each time, a job to execute and a speed for the processor. The goal is to minimize the weighted sum of the flow times over all jobs plus the energy consumption, where the flow time of a job is the time elapsed from release to completion and the energy consumption is given by sαwhere sis the processor speed and α > 1is some constant. For the online algorithm shortest remaining processing time first, the authors prove a (3 + )competitive ratio for the objective of total weighted flow plus energy. Whereas for the online algorithm highest density first (HDF), where the density of a job is its weight-to-work ratio, they prove a (2 + )competitive ratio for the objective of fractional weighted flow plus energy. Recently, Im, Moseley, and Pruhs studied online scheduling for general cost functions of the
2.2 Power Aware Assignment of Virtual Machines to Physical Machines 19 flow time, with the only restriction that such function is non-decreasing [61]. In their model, a collection of jobs, each characterized by a release time, a processing work, and a weight, must be processed by a single server whose speed is variable. A job can be suspended and restarted later without penalty. The authors show that HDF is (2 + )-speed O(1)-competitive against the optimal algorithm on a unit speed-processor, for all non-decreasing cost functions of the flow time. Furthermore, they also show that this ratio cannot be improved significantly proving impossibility results if the cost function is not uniform among jobs or the speed cannot be significantly increased. A generalization of the above problem is studied by Gupta, Krishnaswamy, and Pruhs in [53]. The question addressed is how to assign jobs, possibly fractionally, to unrelated parallel machines in an online fashion in order to minimize the sum of the α-powers of the machine loads plus the assignment costs. Upon arrival of a job, the algorithm learns the increase on the load and the cost of assigning a unit of such job to a machine. Jobs cannot be suspended and/or reassigned. The authors model a greedy algorithm that assigns a job so that the cost is minimized as solving a mathematical program with constraints arriving online. They show a competitive ratio of ααwith respect to the solution of the dual program which is a lower bound for the optimal. They also show how to adapt the algorithm to integral assignments with a O(α)αcompetitive ratio, which applies directly to our (·, m)-VMA problem. References to previous work on the particular case of minimizing energy with deadlines can be found in this paper. Similar cost functions have been considered for the minimum cost network-design problem. In this problem, packets have to be routed through a (possibly multihop) network of speed scalable routers. There is a cost associated to assigning a packet to a link and to the speed or load of the router. The goal is to route all packets minimizing the aggregated cost. In [9] and [10] the authors show offline algorithms for this problem with undirected graph and homogeneous link cost functions that achieve polynomial and poly-logarithmic approximation, respectively. The cost function is the α-th power of the link load plus a link assignment cost, for any constant α > 1. The same problem and cost function is studied in [53]. Bansal et al. [16] study a minimum-cost virtual circuit multicast routing problem with speed scalable links. They give a polynomial-time O(α)-approximation offline algorithm and a polylog-competitive online algorithm, both for the case with homogeneous power functions. They also show that the problem is APX-hard in the case with heterogeneous power functions and there is no polylog-approximation when the graph is directed. Recently, Antoniadis et al. [11] improved the results by providing a simple combinatorial algorithm that is O(logαn)-approximate, from which we can construct an e O(log3α+1 n)-competitive online algorithm. The (·, m)-VMA problem can be seen as a especial case of the problem considered in these papers in which there are only two nodes, source and destination, and mparallel links connecting them. To the best of our knowledge, the problem of minimizing the power consumption (given in Eq.2.1) with capacity constraints (i.e., the (C, m)-VMA and (C, ·)-VMA problems) has received very limited attention, in the realm of both VMA and network design, although the ap-
20 Related Work proaches in [10] and [16] are related to or based on the solutions for the capacitated networkdesign problem [31]. The experimental work related to VMA is vast and its detailed overview is out of the scope of this paper. Some of this work does not minimize energy [29, 72, 75] or it applies to a model different than ours (VM migration [80, 87], knowledge of future load [73, 87], feasibility of allocation [23], multilevel architecture [63, 74, 80], interconnected VMs [26], etc.). On the other hand, some of the experimental work where minimization of energy is evaluated focus on a more restrictive cost function [63,93,97]. In [63], for an energy cost model that is linear, the authors evaluate experimentally the allocation of VMs to clusters following 9 placement policies, some of them included in popular cloud platforms [44, 84]. Namely, Round Robin, Striping, Packing, Load Balancing (free CPU count), Load Balancing (free CPU ratio), Watts per Core, Cost per Core. We adapt 5of these policies (defined later in Chapter 4) to our model and cost function for the purpose of simulations. In [87], the authors focus on an energy-efficient VM placement problem with two requirements: CPU and disk. These requirements are assumed to change dynamically and the goal is to consolidate loads among servers, possibly using migration at no cost. In our model VMs assignment is based on a CPU requirement that does not change and migration is not allowed. Should any other resource be the dominating energy cost, the same results apply for that requirement. Also, if loads change and migration is free, an offline algorithm can be used each time that a load changes or a new VM arrives. In [87] it is shown experimentally that energy-efficient VMA does not merely reduce to a packing problem. That is, to minimize the number of PMs used even if their load is close to their maximum capacity. For our model, we show here that the optimal load of a given server is a function only of the fixed cost of being active (b) and the exponential rate of power increase on the load (α). That is, the optimal load is not related to the maximum capacity of a PM.
Part II Understanding and Reducing Energy Consumption in Data Centers 21
Chapter 3 Analysis of the Energy Consumption of Data Center Servers 3.1 Overview The work presented in this chapter is motivated by our disagreement with some of the models that have been previously proposed in the literature which state that power consumption of data center servers depends linearly on the load. Our belief is that more complex/complete models for the power consumed by a server are necessary. In order to be consistent, these models have to be based on empirical values. However, we found that, despite the large body of work in the field, there is a lack of empirical work studying servers energy behavior. Our work tries to partially fill this void by proposing a measurement-based characterization — which is the first of its kind— of the energy consumption of a server components with DVFS and multiple cores. We evaluate here different server machines and evaluate what is the contribution to their power consumption of the CPU, hard drive disk, and network card (NIC). Our approach captures the influence of the processing frequency and the multiple cores, not only to the CPU power consumption, but also to that of disk input/output (I/O) and NIC activity. Our contribution is threefold: (i)we propose a methodology to empirically characterize the energy consumption of a server, (ii)we provide novel, experimental-based, insights on the energy consumption behavior of the most relevant server’s components, and (iii)we propose an accurate technique to estimate the energy consumption of cloud applications. As concerns the methodology, we propose active CPU cycles per second (ACPS) as a new and more convenient metric for CPU load in multi-core/multi-frequency architectures. We show how to isolate the contribution of energy consumption due to CPU, disk I/O operations, and network activity by just measuring server’s total energy consumption and a few activity indicators reported by the operating system. We also show that the baseline energy consumption of a server — i.e., the energy consumed just because the server is turned on — has a strong impact on server’s total consumption. 23
24 Analysis of the Energy Consumption of Data Center Servers As concerns the components’ energy characterization, we show that, besides the baseline consumption, the CPU has the largest impact among all components, and its energy consumption is not linear with the load. Disk I/O operations are the second highest cause of consumption, and their efficiency is strongly affected by the I/O block size used by the application. Eventually, network activity plays a minor yet not negligible role in the energy consumption, and the network impact scales almost linearly with the network transmission rate. All other components (e.g., memory, fans, GPU, etc.) can be accounted for the baseline energy consumption, which is subject to minor variations under different operational conditions. Specifically, the main results of our measurement campaign are listed below: • The CPU power utilization depends on the number of working cores, the CPU frequency, and the CPU load (in ACPS units). Our measurements confirm that the energy consumption with a single working core at constant frequency can be closely approximated by a linear function of the CPU load. However, given a CPU frequency, the energy consumption in multicore architectures is a concave function of the CPU load and can be approximated by a low-order polynomial. The energy consumption for a fixed CPU load is, in general, minimized by using the highest number of cores and the lowest frequency at which the load can be served. However, the minimum achievable energy consumption is a piecewise concave function of the CPU load. • The energy consumed by hard disks for reading and writing depends on the CPU frequency and the I/O block sizes. Both reading and writing energy costs increase slightly with the CPU frequency. While the energy consumption due to reading is not affected by block size, the energy consumption due to writing increases with the block size. The reading efficiency (expressed in MB/J) is barely affected by the CPU frequency, while writing efficiency is a concave function of the block size since it boosts the throughput of writing until a saturation value is reached. • The energy consumption and the efficiency of the NIC, both in transmission and reception, depends on the CPU frequency, the packet size, and the transmission rate. The efficiency of data transmission increases almost linearly with the transmission rate, with steeper slopes corresponding to lower CPU frequencies. Although a linear relation between transmission rate and efficiency holds for data reception as well, small packet sizes yield higher efficiency in reception. Overall, supported by our measurements, we provide a holistic energy consumption model that only requires a few calibration parameters for every different server architecture which we want to evaluate (a universal energy model will be too simplistic and inaccurate). We validate our model by means of a server computing the PageRank metric of a graph and a WordCount application in a Hadoop platform, first without network activity, next with bulky network activity,
3.2 Methodology 25 and finally in the cloud. We will find that the error of our energy estimates is below 4.1% on average and never worse than a 10%. RoadMap The rest of the chapter is organized as follows. Section 3.2 describes the methodology we used for our experiments. Section 3.3 presents our measurement campaign, for every single component which we tested. In Section 3.4 we model the energy consumption of the servers based on a few calibration parameters which we find during our measurement campaign. In Section 3.5 we discuss our findings and their implications. Finally, Section 3.6 concludes the chapter. 3.2 Methodology In this section we introduce the measurement techniques we used to characterize the power requirements of CPU activity, disk access (read and write operations), and network activity. Our measurements start characterizing the CPU power consumption, from where we obtain information about the baseline power consumption of the system. After CPU and baseline characterization, we follow with experiments for the other two components, namely, disk and network. Note that CPU and baseline measurements are of capital importance in order to evaluate the other components, because any operation run in a machine is like a puzzle with multiple pieces and we must know what is the contribution of each one of these pieces. Consider that, we are paying a cost just for having a server switched on and the operating system running on it. Similarly, every time we run a task in the system, some CPU cycles are needed in order to execute it as well as to use the component that has to perform the task. Hence, in order to understand the contribution of any component, we first need to identify the contribution of the CPU and compute the difference with respect to the aforementioned baseline. To explore the possible parameters which determine the power consumption of a server and to obtain statistical consistency, we run our experiments multiple times. Similarly, we run these experiments in different servers and architectures in order to validate our results and give consistency to our conclusions. 3.2.1 Collecting System Data and Fixing Frequency Parameters One prerequisite for our experiments is to have Linux machines due to the kind of commands and benchmarks we wanted to use and, mainly, because of the possibility of adding some kernel modules and utilities,1which allow us to change CPU frequencies at will. In a Linux system, CPU activity stats are constantly logged, so we can periodically record the core frequency and the number of active and passive CPU ticks at each core.2Once we have the number of ticks and 1For instance cpufrequtils, acpi-cpufreq. 2File /proc/stat reports the number of ticks since the computer started devoted to user,niced and system processes, waiting (iowait), processing interrupts (i.e., irq and softirq), and idle. In our experiments we count both
32 Analysis of the Energy Consumption of Data Center Servers 0 2 4 6 8 10 12 x 109 80 90 100 110 120 130 140 150 160 Load ρ [ACPS] Power Consumption PBC [W] Pmin(ρ) (a) Minimal power. 0 2 4 6 8 10 12 x 109 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 2.2x 108 Load ρ [ACPS] Efficiency ηC [AC/J] ηmax(ρ) (b) Maximal efficiency. Figure 3.3: CPU performance bounds of Nemesis. From the previous figures it emerges that the power consumption due to CPU and baseline can be minimized by selecting the right number of active cores and a suitable CPU frequency. Similarly, we can expect that the energy efficiency, defined as number of active cycles per energy unit, can be maximized by tuning the same operational parameters. We graphically represent the impact of operation parameters on power consumption and energy efficiency in Figures 3.3 and 3.5 respectively for Nemesis and Erdos (results for Survivor are similar to the ones shown for Nemesis and are omitted). In particular, Figures 3.3(a) and 3.5(a) report all possible fitting curves for the power consumption measurements, plus a curve marking the lowest achievable power consumption at a given
3.3 Measurements 33 0123456789 x 109 60 65 70 75 80 85 90 95 100 Load ρ [ACPS] Power Consumption PBC [W] Pmin(ρ) (a) Minimal power. 0123456789 x 109 0.5 1 1.5 2 2.5x 108 Load ρ [ACPS] Efficiency ηC [AC/J] ηmax(ρ) (b) Maximal efficiency. Figure 3.4: CPU performance bounds of Survivor.
34 Analysis of the Energy Consumption of Data Center Servers 0 5 10 15 x 1010 200 250 300 350 400 450 500 550 600 650 Load ρ [ACPS] Power Consumption PBC [W] Pmin(ρ) (a) Minimal power. 0 5 10 15 x 1010 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5x 108 Load ρ [ACPS] Efficiency ηC [AC/J] ηmax(ρ) (b) Maximal efficiency. Figure 3.5: CPU performance bounds of Erdos.
3.3 Measurements 35 load. We name such a curve “minimal power curve” Pmin(ρ), and we observe that (i)it only depends on the load ρ, and (ii)it is a piecewise concave function, which makes it suitable to formulate power optimization problems. Finally, to evaluate the energy efficiency of the CPU, we report in Figures 3.3(b) and 3.5(b) the number of active cycles per energy unit obtained from our measurements respectively for Nemesis and Erdos. We compute the power due to active cycles as the power PBC −α0, i.e., by subtracting the baseline consumption from PBC, and we obtain the efficiency ηCby dividing the load (in active cycles per second) by the power due to active cycles: ηC=ρ PBC(ρ)−α0 .(3.2) Also in this case we show the curve that maximizes the efficiency at a given load, which we name “Maximal efficiency curve” ηmax(ρ). Interestingly, we observe that (i)ηmax(ρ)presents multiple local maxima, (ii)for a given configuration of frequency and number of active cores, the efficiency is maximized at the highest achievable load, (iii)all local maxima corresponds to the use of all available active cores, but (iv)the absolute maximum is not achieved neither at the highest CPU frequency nor at the lowest. 3.3.3 Disks We now characterize the power and energy consumption of disk I/O operations. During the experiments, we continuously commit either read or write operations, while keeping the CPU load ρas low as possible (i.e., we disconnect the network and we do not run other tasks). Still, the power measurements obtained during the disk experiments contain both the power used by the disk and power due to CPU and baseline. Indeed, Figure 3.6 shows, for each experiment, the total measured power Pt, the power PBC computed according to Eq. 3.1 at the load ρmeasured during the experiment, and the power due to disk operations, computed as: Px D=Pt−PBC(ρ), x ∈ {r, w},(3.3) where superscripts rand wrefer to reading and writing operations, respectively. We test sequentially all the available frequencies for each server (see Table 3.1), and I/O block sizes ranging from 10 KB to 100 MB. Figure 3.6 shows average and standard deviation of the measures over 10 experiment repetitions for each one of our servers. Indeed, it can be easily seen that Survivor and Nemesis have similar disks and file systems, while Erdos is equipped with SAS disks with RAID. In all cases shown in the figure, the disk power is small but not negligible with respect to the baseline consumption. Furthermore, we can observe that the two servers presented behave differently. Indeed, while the power consumption due to writing is affected both by the block size Bfor both machines, we observe that both Nemesis and Survivor’ disk writing power Pw D is not affected by the CPU frequency, while Erdos’ results show an increase with the frequency. Moreover, the results obtained with Erdos are affected by a substantial amount of variability
36 Analysis of the Energy Consumption of Data Center Servers in the measurements, which we believe is due to the caching operations enforced by the RAID mechanism in Erdos. Similarly to what was described for the CPU, we now comment on the energy efficiencies ηr Dand ηw Dof disk reading and writing operations. Figure 3.7 reports efficiency as a function of the I/O block size, and shows one line per each CPU frequency7. The efficiency is computed by subtracting the baseline power from the total power, and by measuring the volume Vof data read or written in an interval T: ηx D=V Px DT, x ∈ {r, w}.(3.4) We can observe that results are similar for all the servers. Specifically, reading efficiency is almost constant at any frequency and for each block size, while writing is more efficient with large block sizes. We also observe that the efficiency changes very little with the adopted CPU frequency. Another observation is that the efficiency saturates to a disk-dependent asymptotic value, which is due to the mechanical constraints of the disk (e.g., due to the non-negligible seek time, the number of read/write operations per second is limited). In addition, although not visible in the figure due to the log-scale adopted, ηw Dis a concave function of the block size B. 3.3.4 Network The last server component that we characterize via measurements is the network card. Similarly to the cases described previously, we run experiments in which only the operating system and our test scripts are active. In this case, we run a script to either transmit or receive UDP packets over a gigabit Ethernet connection and count the system active cycles ρ. We measure the total power consumption Ptduring the experiment, so that the power due to network activity can be then estimated as follows: Px N=Pt−PBC(ρ), x ∈ {s, r},(3.5) where superscripts sand rrefer to the sender and the receiver cases, respectively. In the experiments, we sequentially test all the available frequencies for each server (see Table 3.1), and fix the packet size and the transmission rate within the achievable set of rates (which depends on the packet size, e.g., <950 Mbps for 1470-B packets). We report results for the network energy consumption in terms of efficiencies ηs Nand ηr N(volume of data transferred per unit of energy). These efficiencies are computed as follows: ηx N=R Px N , x ∈ {s, r},(3.6) where Ris the transmission rate during the experiment. Figures 3.8, 3.9 and 3.10 show the network efficiencies of Survivor,Nemesis and 7For readability, results for Survivor are omitted.
3.3 Measurements 37 10 15 20 80 85 90 95 100 105 1.596 1.729 1.862 1.995 2.128 2.261 2.394 2.527 2.66 2.793 2.794 1.596 1.729 1.862 1.995 2.128 2.261 2.394 2.527 2.66 2.793 2.794 1.596 1.729 1.862 1.995 2.128 2.261 2.394 2.527 2.66 2.793 2.794 1.596 1.729 1.862 1.995 2.128 2.261 2.394 2.527 2.66 2.793 2.794 Frequency [GHz] Power PD r [W] Measured Power Disk Power CPU + BL power 1 MB 10 KB 10 MB 100 MB (a) Power consumption during reading (Nemesis). 0 5 10 15 20 80 85 90 95 100 105 1.596 1.729 1.862 1.995 2.128 2.261 2.394 2.527 2.66 2.793 2.794 1.596 1.729 1.862 1.995 2.128 2.261 2.394 2.527 2.66 2.793 2.794 1.596 1.729 1.862 1.995 2.128 2.261 2.394 2.527 2.66 2.793 2.794 1.596 1.729 1.862 1.995 2.128 2.261 2.394 2.527 2.66 2.793 2.794 Frequency [GHz] Power PD w [W] Measured Power Disk Power CPU + BL power 100 MB 10 MB 1 MB 10 KB (b) Power consumption during writing (Nemesis). 10 15 20 25 30 75 80 1.2 1.333 1.467 1.6 1.733 1.867 2 2.133 1.2 1.333 1.467 1.6 1.733 1.867 2 2.133 1.2 1.333 1.467 1.6 1.733 1.867 2 2.133 1.2 1.333 1.467 1.6 1.733 1.867 2 2.133 Frequency [GHz] Power PD r [W] Measured Power Disk Power CPU power 100MB 10MB 1MB 10KB (c) Power consumption during reading (Survivor). 0 5 10 15 52.5 57.5 62.5 67.5 72.5 77.5 1.2 1.333 1.467 1.6 1.733 1.867 2 2.133 1.2 1.333 1.467 1.6 1.733 1.867 2 2.133 1.2 1.333 1.467 1.6 1.733 1.867 2 2.133 1.2 1.333 1.467 1.6 1.733 1.867 2 2.133 Frequency [GHz] Power PD w [W] Measured Power Disk Power CPU power 100MB 10MB 1MB 10KB (d) Power consumption during writing (Survivor). 65 75 85 95 225 235 245 255 265 275 285 295 305 315 325 335 1.4 1.6 1.8 2.1 2.3 1.4 1.6 1.8 2.1 2.3 1.4 1.6 1.8 2.1 2.3 1.4 1.6 1.8 2.1 2.3 Frequency [GHz] Power PD r [W] Measured Power Disk Power CPU + BL power 100 MB 10 MB 1 MB 10 KB (e) Power consumption during reading (Erdos). 25 35 45 55 65 75 85 95 235 245 255 265 275 285 295 305 315 325 335 345 355 365 375 1.4 1.6 1.8 2.1 2.3 1.4 1.6 1.8 2.1 2.3 1.4 1.6 1.8 2.1 2.3 1.4 1.6 1.8 2.1 2.3 Frequency [GHz] Power PD w [W] Measured Power Disk Power CPU + BLmpower 100 MB 10 MB 1 MB 10 KB (f) Power consumption during writing (Erdos). Figure 3.6: Instantaneous power consumption for reading/writing operations. Results are presented for every frequency and for 4different block sizes for each one of our servers.
38 Analysis of the Energy Consumption of Data Center Servers 100101102103104105 10−1 100 101 102 103 104 Block Size B [KB] Efficiency [KB/J] ηD r ηD w Figure 3.7: Disk reading and writing efficiencies for Erdos (red dotted lines) and Nemesis (blue solid lines). Erdos, respectively, averaged over 5samples per transmission rate R.8 9 For the sake of readability, the figures only show results for the biggest and smallest packet sizes, i.e., 64-B and 1470-B packets. For Nemesis and Survivor we report four CPU frequencies: the lowest, the highest, the most efficient (according to Figures 3.3(b) and 3.4(b)) and an intermediate one. For Erdos all five available frequencies are shown. The figure also reports the polynomial fitting curves for efficiency, which we found to be at most of second order. Since the efficiency is represented in terms of network activity only, in the fitting we force the zero-order coefficient of the polynomials to be 0. Therefore, we can use the following expression to characterize the network efficiencies of our servers: ηx N=β1R+β2R2, x ∈ {s, r},(3.7) where the βicoefficients are computed by minimizing the least square error of the fitting. It can observed in Figures 3.8, 3.9 and 3.10 that efficiencies are almost linear or slightly superlinear with the transfer rate, e.g., the receiving efficiency of Survivor exhibits an evident quadratic behavior. Indeed, our measurements show that the network power consumption is independent from the throughput, which is a well known result for legacy Ethernet devices. In fact, the NICs of our servers are not equipped with power saving features like, e.g., the recently standardized IEEE 802.3az [60]. In all cases, the efficiency is strongly affected by the selected CPU frequency. Moreover, efficiency is also affected by packet size, although the impact of packet size changes from server to server, e.g., Survivor sending efficiency is only slightly affected by it. Another observation is that, depending on the packet size and frequency used, sending can 8Network results are obtained by using a point-to-point Ethernet connection between two controlled servers. 9Due to technical and regulation reasons it was only possible to complete the sender part for Erdos, obtaining only partial results which, because of this partiality, are not published.
3.3 Measurements 39 0 2 4 6 0 50 100 150 200 250 300 Efficiency ηNr [MB/J] Transfer rate R [Mbps] 1.2GHz 1.6GHz 1.867GHz 2.133GHz (a) Receiver efficiency in Survivor when using 64-B packets. 0 2 4 0 50 100 150 200 250 Efficiency ηNs [MB/J] Transfer rate R [Mbps] 1.2GHz 1.6GHz 1.867GHz 2.133GHz (b) Sender efficiency in Survivor when using 64-B packets. 0 4 8 12 16 20 0 200 400 600 800 1000 Efficiency ηNr [MB/J] Transfer rate R [Mbps] 1.2GHz 1.6GHz 1.867GHz 2.133GHz (c) Receiver efficiency in Survivor when using 1470-B packets. 0 4 8 12 16 20 0 200 400 600 800 1000 Efficiency ηNs [MB/J] Transfer rate R [Mbps] 1.2GHz 1.6GHz 1.867GHz 2.133GHz (d) Sender efficiency Survivor when using 1470-B packets. Figure 3.8: Network efficiencies for Survivor under different frequencies and 64-B and 1470- B packets.
40 Analysis of the Energy Consumption of Data Center Servers 0 2 4 6 0 50 100 150 200 250 300 350 400 Efficiency ηNr [MB/J] Transfer rate R [Mbps] 1.596GHz 2.128GHz 2.394GHz 2.794GHz (a) Sender efficiency in Nemesis when using 64-B packets. 0 0.5 1 1.5 2 2.5 3 3.5 4 0 50 100 150 200 250 300 Efficiency ηNs [MB/J] Transfer rate R [Mbps] 1.596GHz 2.128GHz 2.394GHz 2.794GHz (b) Sender efficiency in Nemesis when using 64-B packets. 0 2 4 6 8 0 200 400 600 800 1000 Efficiency ηNr [MB/J] Transfer rate R [Mbps] 1.596GHz 2.128GHz 2.394GHz 2.794GHz (c) Sender efficiency in Nemesis when using 1470-B packets. 0 2 4 6 8 10 12 14 16 18 0 200 400 600 800 1000 Efficiency ηNs [MB/J] Transfer rate R [Mbps] 1.596GHz 2.128GHz 2.394GHz 2.794GHz (d) Sender efficiency in Nemesis when using 1470-B packets. Figure 3.9: Network efficiencies for Nemesis under different frequencies and 64-B and 1470-B packets.
3.4 Estimating Energy Consumption 41 0 2 0 50 100 150 200 250 Efficiency ηNs [MB/J] Transfer Rate R [Mbps] 1.4GHz-64B 1.6GHz-64B 1.8GHz-64B 2.1GHz-64B 2.3GHz-64B (a) Sender efficiency in Erdos when using 64- B packets. 0 2 4 6 8 10 12 0 200 400 600 800 1000 Efficiency ηNs [MB/J] Transfer Rate R [Mbps] 1.4GHz-1470B 1.6GHz-1470B 1.8GHz-1470B 2.1GHz-1470B 2.3GHz-1470B (b) Sender efficiency in Erdos when using 1470-B packets. Figure 3.10: Network efficiencies for Erdos under different frequencies and 64-B and 1470-B packets. be more energy efficient than receiving at a given transmission rate, and using the highest CPU frequency is never the most efficient solution. Note also that the efficiency decreases with the packet size, although this effect is particularly evident at the receiver side, while it only slightly impacts the efficiency of the packet sender. However, network activity also causes non-negligible CPU activity, as shown in Figure 3.11 for a few experiment configurations for all three servers. Overall, the lowest CPU frequency yields the lowest total power consumption during network activity periods. 3.4 Estimating Energy Consumption While the results presented in the previous sections are useful to understand the energy consumption pattern of CPU, disk and network, we believe that a much more important use of these results is to estimate the energy consumption of applications. In this section we describe how this can be done from simple data about the application. Moreover, we validate the proposed approach by estimating the energy consumed by several map-reduce Hadoop computations.
48 Analysis of the Energy Consumption of Data Center Servers (a) WordCount, sender side. (b) WordCount, receiver side. Figure 3.14: Energy consumption of Nemesis running WordCount in the Connected Server scenario, with either small or big packets.
3.4 Estimating Energy Consumption 49 Table 3.2: Error measured in the different cases of the Connected Server scenario. Packet Size Freq Cases PR - Send PR - Rec WC - Send WC - Rec 64-B 1.596 0.5% 6.0% 2.9% 2.7% 2.128 2.0% 4.7% 6.4% 1.5% 2.794 0.5% 2.9% 4.0% 2.9% 1470-B 1.596 0.7% 6.9% 1.6% 6.5% 2.128 1.1% 6.5% 5.8% 5.8% 2.794 3.8% 0.3% 0.9% 1.5% from the server itself by consulting the OS registers11. Therefore, the energy of the network for an run i,Ei N, is obtained using Eq. 3.11. Then, including Ei Nfor each run in the computation of Ei app we can obtain the total energy consumed by the application. Following the same steps as in the previous scenario, we get the results shown in Figure 3.13 and 3.14. The error measured is again relatively smaller for PageRank than for WordCount. The error measured for each of the cases can be found in Table 3.2. We finally analyze the Cloud scenario. In this scenario we set up a cluster with two servers, Nemesis and Survivor, and run the 2aforementioned Hadoop applications in it. This scenario may seem relatively similar to the Connected Server scenario, but it has is a major difference. While in the previous scenario we were the ones controlling the network traffic, here the traffic is controlled by Hadoop. Specifically, we know that, in this scenario, there are two main sources of traffic: requesting input data when it is not present in a server, and sending the mapper tasks outputs to the reducer tasks. The only condition we impose in the server to have some control over the traffic is related to this later aspect, we force the reducers to be always in Nemesis. Although we are able to retrieve the total amount of data received or sent by each server, we know neither the size of the packets used nor the rate. Therefore, we can compute neither the sending efficiency ηs Nnor the receiving efficiency ηr N. In order to be able to compute both the sending and receiving efficiencies we analyze the traffic exchanged by both servers for each one of the applications. Figure 3.15 shows the amount of packets of each size that were exchanged by both servers (and the direction of the exchange) for both applications. The results show the vast majority of packets are either small (64 bytes) or big (1470 bytes). Moreover, it shows that most of the packets sent from Nemesis to Survivor are small packets for both applications, while big packets are sent in the opposite direction. Given these results, we approximate the energy consumed by the network assuming that all the packets exchanged are of the same size and that the rate is the maximum achievable rate for each packet size according to the results from Section 3.3. For instance, we consider roughly 30 Mbps when Survivor receives 64-Byte packets and roughly 970 Mbps if it sends 1470-Byte packets. These assumptions allow us to compute now ηs Nand ηr N. The remaining parameters are computed 11We can read the registers rx bytes, rx packets, tx bytes or tx packets from /sys/class/net/eth0/statistics.
50 Analysis of the Energy Consumption of Data Center Servers 0 0.2 0.4 0.6 0.8 1 64 65-1469 1470 >1470 64 65-1469 1470 >1470 Packet distribution [%] Packet size [Bytes] Pagerank Wordcount Nemesis->Survivor Survivor->Nemesis Figure 3.15: Distribution of the sizes of the packets exchanged between Nemesis and Survivor for both PageRank and WordCount in the Cloud scenario. as for the other scenarios, so to determine ˆ Eapp and Eapp. The results are shown in Figure 3.16. As in the previous scenarios, errors are relatively low. In particular, the error in Nemesis when running PageRank is 3.1% and 1.4% for 2.128 GHz and 2.794 GHz, respectively, and of a 9.7% and a 6.5% for 2.128 GHz and 2.794 GHz when running WordCount. On the other hand, the measured errors for Survivor are 3.3% and 3.6% for 1.867 GHz and 2.133 GHz when running PageRank and 5.1% and 5.2%, respectively, when running WordCount. 3.5 Discussion We discuss now some of the implications of our results. We start with consolidation as a technique for energy saving. It has been often assumed that the best way of saving energy is by using the highest frequency available and applying consolidation (which is to fill servers as much as possible). This reduces the total number of servers being used, allowing to switch off the rest. This assumption has led to proposing bin-packing based solutions [24,76, 82,95]. However, the results presented in Figures 3.3(b), 3.4(b) and 3.5(b) show that the highest frequency is not always the most efficient one, and this has been found to be true for two different architectures (Intel and AMD). This implies that, by running servers at the optimal amount of load, and the right frequency, a considerable amount of energy could be saved. A second relevant aspect is the baseline consumption of servers. The results presented for all 3servers show that their baselines are within a 30-50% of the maximum consumption. Then, it is obvious that more effort has to be done for reducing baseline consumption. For instance, a solution could consist in switching off cores in real time, not just disabling them, or in introducing very fast transitions between active and lower energy states, i.e., to achieve real suspension in idle state. There is another relevant issue related to the CPU load associated to disk and network activity.
3.5 Discussion 51 (a) Nemesis (b) Survivor Figure 3.16: Energy consumption of Nemesis and Survivor in the Cloud scenario.
52 Analysis of the Energy Consumption of Data Center Servers It can be observed in Figure 3.6 that disks do not incur much CPU overhead. In fact, the power used by the CPU plus baseline does not change much across the experiments. Instead, the energy consumed by the CPU due to network operations is even larger than the energy consumed by the NIC (see Figure 3.11). Some works, like [47], have already pointed out that the way packets are handled by the protocol stack is not energy efficient. Our results reinforce this feeling and point out that building a more efficient protocol stack would certainly reduce the amount of energy consumed due to the network. Finally, it is worth to mention that in this work we have assumed that the power utilization of the RAM memory is included in the baseline. The characterization experiments have been run in such a way that there were few memory accesses, so its power utilization did not affect our measurements. However, RAM memory became an uncontrolled source of power utilization in Section 3.4.3 when we validated our proposed model. In fact, all the Hadoop processes that run in the servers consume significant RAM memory. This impacts more significantly the memory used by the cluster’s master node, since it runs internal Hadoop processes (such as the NameNode or the JobTracker) whose memory requirement increases with the number of mappers and reducers. This cost is, therefore, paid only in Nemesis, the master node of our cluster, and not in Survivor, which explains the different accuracy of the model for the two servers. This error is particularly evident when when WordCount is run, due to the fact that the required number of mappers for WordCount is larger than for PageRank and, therefore, the RAM required in Nemesis increases and so does the uncontrolled energy consumption. 3.6 Conclusions In this chapter we have reported our measurement-based characterization of energy and power consumption in a server. We have exhaustively measured the power consumed by CPU, disk, and NIC under different configurations, identifying the optimal operational levels, which usually do not correspond to the static system configurations commonly adopted. We found that, besides the baseline component, which does not changes significantly with the operational parameters, the CPU has the largest impact on energy consumption among all the three components. We observe that CPU consumption is neither linear nor concave with the load, i.e., the systems are not energy proportional. Disk I/O is the second larger contributor to power consumption, although performance changes sensibly with the I/O block size used by the applications. Finally, the NIC activity is responsible for a small but not negligible fraction of power consumption, which scales almost linearly with the network transmission rate. In general, most of the energy/power performance figures do not scale linearly with the utilization, in contrast to what is commonly assumed in the literature. We have then shown how to predict and optimize the energy consumed by an application via a concrete example using 2different Hadoop applications, PageRank and WordCount, in three different scenarios. First We ran both applications without network activity, next with bulky network activity, and finally in a two-server cluster. Our model achieves very accurate energy
3.6 Conclusions 53 estimates, within 4.1% from the measured total power consumption on average and never worse than a 10%.
Chapter 4 Efficient Assignment of Virtual Machines to Physical Machines 4.1 Overview Having studied how nowadays servers use power, we now show a way in which this knowledge can be useful. In this chapter we will apply the concept of the optimal operational point of a server to the Virtual Machine Assignment problem (VMA), which basically consists in deciding in which server we want to place a new task arriving to a system. Having an optimal operational point conditions drastically the way we must load a server in order to optimize the energy which is being consumed. Having this in mind, we study, in particular, the hardness and online competitiveness of the four versions of the VMA problem that we described in Chapter 2. This 4versions of VMA differed in whether we considered PMs with bounded or unbounded capacity Cor a limited or unlimited number of PMs min the system. We denoted these versions as (·,·)-VMA, (C, ·)- VMA, (·, m)-VMA and (C, m)-VMA1. We start by showing various lower and upper bounds on the offline approximation of VMA. The first fact we observe is that there is a hard decision version of (C, m)-VMA: Is there a feasible partition πof the set Dof VMs? By reduction from the 3-Partition problem, it can be shown that this decision problem is strongly NP-complete. We then show that the (·,·)-VMA, (C, ·)-VMA, and (·, m)-VMA problems are NP-hard in the strong sense, even if αis constant. This result implies that VMA problems do not have a fully polynomial time approximation scheme (FPTAS), even if αis constant. Nevertheless, using previous results derived for more general objective functions, we notice that (·,·)-VMA and (·, m)-VMA have a polynomial time approximation scheme (PTAS), while the (C, ·)-VMA problem can not be approximated beyond a ratio of 3 2· α−1+( 2 3)α α(unless P = NP). On the positive side, we show how to use an existing Asymptotic PTAS [45] to obtain algorithms that approximate the optimal solution of (C, ·)-VMA. All our 1The central dots (·)imply unboundedness. 55
56 Efficient Assignment of Virtual Machines to Physical Machines offline results as well as the online ones can be seen in Table 4.1. Then we move on to online VMA algorithms. We show various upper and lower bounds on the competitive ratio of the four versions of the problem. Observe that the results are often different depending on whether x∗is smaller than Cor not. In fact, when x∗< C, there is a lower bound of (3/2)2α−1 2α−1that applies to all versions of the problem. Rather than attempting to obtain tight bounds for particular instances of the parameters of the problem (C, m, α, b) we focus on obtaining general bounds, whose parameters can be instantiated for the specific application. The bounds obtained show interesting trade-offs between the PM capacity and the fixed cost of adding a new PM to the system. For clarity, we will consider µ= 1 throughout the whole chapter. All the results presented apply for other values of µ. The resulting bounds are shown in Table 4.1. As can be observed, the resulting upper and lower bounds are not very far in general. To give some intuition on the tightness of these bounds, we instantiate them for a realistic value of α= 3, and normalized values of b= 2 and C∈ {1,2}. These values for αare obtained from the servers we studied in Chapter 3, in particular from the ones denoted as Erdos and Nemesis. In them the values for αare close to 1.5and 3and x∗values of 0.76Cand 0.9Crespectively (x∗denotes the load that minimizes the ratio power consumption against load.). The bounds based on these realistic values are shown in Table 4.2. RoadMap The rest of the chapter is organized as follows. Section 4.2 includes some preliminary results that will be used throughout the chapter. The offline and online analyses are included in Section 4.3 and 4.4 respectively. In Section 4.5 we compare different state of the art allocation policies and compare them with the algorithms proposed in Section 4.4. Section 4.6 discusses some practical issues and provides some useful insights regarding real implementation. Section 4.7 concludes the Chapter. 4.2 Preliminaries The following claims will be used in the analysis. We call power rate the power consumed per unit of load in a PM. Let xbe the load of a PM. Then, its power rate is computed as f(x)/x. The load at which the power rate is minimized, denoted x∗, is the optimal load, and the corresponding rate is the optimal power rate ϕ∗=f(x∗)/x∗. Using calculus we get the following observation. Observation 1. The optimal load is x∗= (b/(α−1))1/α .Additionaly, for any x6=x∗, f(x)/x > ϕ∗. The following lemmas will be used in the analysis. Lemma 1. Consider two solutions π={A1, . . . , Am}and π0={A0 1, . . . , A0 m}of an instance of the VMA problem, such that for some x, y ∈[1, m]it holds that •Ax6=∅and Ay6=∅;
4.2 Preliminaries 57 VMA subprob. x∗< C x∗≥C (C, ·)offline ρ≥3 2 α−1+(2/3)α αρ≥3 2 α−1+(2/3)α α ρ < m m∗1 + +1 α−1+1 mρ < 1 + +Cα b+1 m (C, ·)online ρ≥(3/2)2α−1 2α−1ρ≥Cα+2b b+max{Cα,2(C/2)α+b} ρ= 1 if Ds=∅, else ρ≤1−1 α1−1 2α2 + x∗ `(Ds)ρ≤2b C1 + 1 (α−1)2α2 + C `(D) (C, m)online ρ≥(3/2)2α−1 2α−1ρ≥Cα+2b b+max{Cα,2(C/2)α+b} (·,·)online ρ≥(3/2)2α−1 2α−1not applicable ρ= 1 if Ds=∅, else ρ≤1−1 α1−1 2α2 + x∗ `(Ds) (·, m)online ρ≥max{(3/2)2α−1 2α−1,3α 2α+2+}not applicable ρ≤O(α)αIn [53] (·,2) online ρ≥max{3α 2α+1 ,(3/2)2α−1 2α−1,3α 2α+2+}not applicable ρ= 1 if `(D)≤α pb/(2α−2), else ρ≤max{2,3 2α−1} Table 4.1: Summary of bounds on the approximation/competitive ratio ρ. All lower bounds are existential. The number of PMs in an optimal (C, ·)-VMA solution is denoted as m∗. The number of PMs in an optimal Bin Packing solution is denoted as m. The load that minimizes the ratio power consumption against load is denoted as x∗. The subset of VMs with load smaller than x∗ is denoted as Ds. •A0 x=Ax∪Ay,A0 y=∅, and Ai=A0 i, for all i6=xand i6=y; and •`(Ax) + `(Ay)≤min{x∗, C}. Then, P(π0)< P(π). Proof : Let `(Ai) = xand `(Aj) = y. First we notice that π0is feasible because x+y≤C. Now, using that x+y≤x∗, we have b= (x∗)α(α−1) ≥(x+y)α(α−1) >(x+y)α≥(x+y)α−(xα+yα) where the second inequality comes from the fact that α > 1. The above inequality is equivalent to 2b+xα+yα> b + (x+y)α,
64 Efficient Assignment of Virtual Machines to Physical Machines in Eq. (4.1) we have ρ < bmγCα(α−1) + `(D) CCα mγCα(α−1) + mC 2α =bmγ(α−1) + `(D) C mγ(α−1) + m1 2α≤bmγ(α−1) + m mγ(α−1) + m 2α(4.3) ≤(m(1 + ) + 1))γ(α−1) + m mγ(α−1) + m 2α(4.4) =(1 + )γ(α−1) + 1 γ(α−1) + 1 2α+γ(α−1) mγ(α−1) + m 2α =2α((1 + )γ(α−1) + 1) 2αγ(α−1) + 1 +2αγ(α−1) m(2αγ(α−1) + 1) <(1 + )γ(α−1) + 1 γ(α−1) +1 m = 1 + +1 γ(α−1) +1 m= 1 + +Cα b+1 m Inequality (4.3) follows from `(D)/C ≤m, Inequality (4.4) from the approximation algorithm for bin packing, and the last inequality is because m > 0. 4.3.3.3 Upper bound on the approximation ratio for x∗< C We study now the (C, ·)-VMA problem when x∗< C. In this case, the optimal load per PM is less than its capacity, so an optimal solution would load every PM to x∗if possible, or try to balance the load close to x∗. In this case we slightly modify the bin packing algorithm described above, reducing the bin size from Cto x∗. Then, using an approximation algorithm for this bin packing problem, the following theorem can be shown. Theorem 5. For every > 0, there exists an approximation algorithm for the (C, ·)-VMA problem when x∗< C that achieves an approximation ratio of ρ < m m∗(1 + ) + 1 α−1+1 m∗, where m∗is the number of PMs used by the optimal solution of (C, ·)-VMA, and mis the minimum number of PMs required to allocate all the VMs without exceeding load x∗(i.e., the optimal solution of the bin packing problem). Proof : Consider an instance of the (C, ·)-VMA problem. If `(D)≤x∗then the optimal solution is to assign all the VMs to one single PM. Then, in the rest of the proof we assume that `(D)> x∗. Assuming m∗to be the number of PMs of an optimal (C, ·)-VMA solution π∗for load `(D), from Corollary 1, we can claim that the power consumption P(π∗)can be bounded as P(π∗)≥m∗b+m∗(`(D)/m∗)α.
4.4 Online Analysis 65 Now, let mbe the minimum number of PMs required to allocate all the VMs of the (C, ·)- VMA problem without exceeding load x∗. As shown in [45], for every > 0, there is a polynomial-time algorithm that fits all VMs in bmbins, where bm≤(1+)m+1. From Lemma 2, this approximation results in a power consumption no larger than bmb + (`(D)/x∗)(x∗)α. Hence, the approximation ratio ρof the solution obtained wit this algorithm can be bounded as follows. ρ≤bmb +`(D) x∗(x∗)α m∗b+m∗`(D) m∗α.(4.5) Since `(D)> x∗, we know that `(D)/m∗> x∗/2, since otherwise there are two used PMs whose load is no larger than x∗, contradicting by Lemma 1 the definition of m∗. Also, from the definition of m, it follows that `(D)≤m·x∗. Finally, recall that b= (x∗)α(α−1). Applying these results to Eq. (4.5) we have the following. ρ < bm(x∗)α(α−1) + x∗m x∗(x∗)α m∗(x∗)α(α−1) + m∗x∗ 2α =bm(α−1) + m m∗(α−1) + m∗1 2α≤(m(1 + ) + 1)(α−1) + m m∗(α−1) + m∗ 2α =m(1 + )(α−1) + m m∗(α−1) + m∗ 2α +α−1 m∗(α−1) + m 2α =m m∗ 2α((1 + )(α−1) + 1) 2α(α−1) + 1 +2α(α−1) 2αm∗(α−1) + m∗ ≤m m∗(1 + ) + 1 α−1+1 m∗, where the first inequality comes from applying the results aforementioned, and second one from using bm=m(1 + )+1, while the last one results from simplifying the previous equation. 4.4 Online Analysis In this section, we study the online version of the VMA problem, i.e., when the VMs are revealed one by one. We first study lower bounds and then provide online algorithms and prove upper bounds on their competitive ratio. 4.4.1 Lower Bounds In this section, we compute lower bounds on the competitive ratio for (·,·)-VMA, (C, ·)- VMA, (·, m)-VMA, (C, m)-VMA and (·,2)-VMA problems. We start with one general construction that is used to obtain lower bounds on the first four cases. Then, we develop special
66 Efficient Assignment of Virtual Machines to Physical Machines constructions for (·, m)-VMA and (·,2)-VMA that improve the lower bounds for these two problems. 4.4.1.1 General Construction We prove lower bounds on the competitive ratio of (·,·)-VMA, (C, ·)-VMA, (·, m)-VMA and (C, m)-VMA problems. These lower bounds are shown in the following two theorems. In Theorem 6, we prove a lower bound on the competitive ratio that is valid in the cases when Cis unbounded and when it is larger or equal than x∗. The case C≤x∗is covered in Theorem 7. Theorem 6. There exists an instance of problems (·,·)-VMA, (·, m)-VMA, (C, ·)-VMA and (C, m)-VMA when C > x∗, such that no online algorithm can guarantee a competitive ratio smaller than (3/2)2α−1 2α−1. Proof : We consider a scenario where, for any online algorithm, an adversary injects VMs of size x∗( > 0is an arbitrarily small constant) to the system until the algorithm starts up a new PM. Let us assume that the total number of VMs injected is k. According to the adversary’s behavior, the assignment of the VMs should be that all the VMs except one are allocated to a single PM while the second PM has only one VM. Depending on what the optimal solution is, we discuss the following two cases: Case 1: k≤1 α−1 1−21−α1/α. The optimal solution will allocate all the VMs to a single PM. Consequently, the competitive ratio of the online algorithm satisfies ρ(k)≥lim →0((k−1)x∗)α+ (x∗)α+ 2b (kx∗)α+b. It can be easily verified that function ρ(k)is monotone decreasing with k. That is, ρ(k)is minimized when k=1 α−1 1−21−α1/α. As a result, we obtain, ρ(k)≥lim →0 α−1 1−21−α1/α x∗α + (x∗)α+ 2b α−1 1−21−α1/α x∗α +b =α−1 1−21−α1/α x∗α + 2(x∗)α(α−1) α−1 1−21−α1/α x∗α + (x∗)α(α−1) =3−21−α 2−21−α=(3/2)2α−1 2α−1. Case 2: k > 1 α−1 1−21−α1/α. The optimal solution will use two PMs with k/2PMs assigned to
4.4 Online Analysis 67 each PM. Accordingly, the competitive ratio of the online algorithm satisfies ρ(k)≥lim →0 ((k−1)x∗)α+ (x∗)α+ 2b 2kx∗ 2α+ 2b!. Similarly, we observe that ρ(k)is monotone increasing with k. Consequently, the following inequality applies. ρ(k)≥lim →0 α−1 1−21−α1/α x∗α + (x∗)α+ 2b 21 2α−1 1−21−α1/α x∗α + 2b =α−1 1−21−α1/α x∗α + 2(x∗)α(α−1) 21 2α−1 1−21−α1/α x∗α + 2(x∗)α(α−1) =3−21−α 2−21−α=(3/2)2α−1 2α−1 Note that it can also happen that C < α−1 1−21−α1/α x∗. In this case, kis smaller than 1 α−1 1−21−α1/α. Therefore, the competitive ratio is always larger than (3/2)2α−1 2α−1, proving the lower bound. Theorem 7. There exists an instance of problems (C, ·)-VMA and (C, m)-VMA when C≤x∗ such that no online algorithm can guarantee a competitive ratio smaller than (Cα+ 2b)/(b+ max(Cα,2(C/2)α+b)). Proof : Similarly to the proof of Theorem 6, we prove the result by considering an adversarial injection of VMs of size C. This injection stops when a new PM started up by an online algorithm. We discuss the following two cases: Case 1: k≤1/. In this case, the optimal algorithm will assign all the VMs to a single PM. The competitive ratio of the online algorithm satisfies ρ(k)≥lim →0 ((k−1)C)α+ (C)α+ 2b (kC)α+b ≥lim →0 (1 −)αCα+ 2b Cα+b ≥Cα+ 2b Cα+b≥2−1 α The second inequality results from applying k≤1/, which is observed from the monotone decreasing property of function ρ(k). The last inequality comes from computing the limit when goes to 0and by applying b≥Cα(α−1). Case 2: k > 1/. In this case, the adversary stops injecting VMs as there will be, mandatorily,
68 Efficient Assignment of Virtual Machines to Physical Machines two active PMs, one of them not capable to allocate more VMs and the second one hosting one single VM. Since all the VMs can not be consolidated to a single PM. The optimal solution would use also two PMs but evenly balancing the loads among them. The competitive ratio of the online algorithm satisfies ρ(k) = lim →0 ((k−1)C)α+ (C)α+ 2b 2kC 2α+ 2b! = lim →0 Cα+ (C)α+ 2b 2C+C 2α+ 2b! =Cα+ 2b 2C 2α+ 2b. Hence, combining the results from both cases 1and 2we obtain the bound presented in Theorem 7. 4.4.1.2 Special Constructions for (·, m)-VMA and (·,2)-VMA We show first that for mPMs there is a lower bound on the competitive ratio that improves the previous lower bound when α > 4.5. Secondly, we prove a particular lower bound for problem (·,2)-VMA, that improves the previous lower bound when α > 3. Theorem 8. There exists an instance of problem (·, m)-VMA such that no online algorithm can guarantee a competitive ratio smaller than 3α/(2α+2 +)for any > 0. Proof : We prove the result by giving an adversarial arrival of VMs. We evaluate the competitive ratio of any online algorithm ALG with respect to an algorithm OPT that distributes the VMs among all the PMs “as evenly as possible”. We define a value β > 1such that ≥(α−1)/βα for some value > 0. Note that such value βcan be defined for any > 0. The adversarial arrival follows. In a first phase, mVMs arrive, each with load βx∗. Let πbe the partition given by ALG. We show first that if πuses less than 3m/4PMs2or some PM is assigned more than 2 VMs there exists another partition that can be obtained from π, it uses exactly 3m/4PMs, no PM is assigned more than 2 VMs, and the power consumption is not worse. If πuses less than 3m/4PMs, then there exists another partition π0that uses exactly 3m/4 PMs with a power consumption that is not worse than P(π). To see why, notice that there are PMs in πthat are assigned more than one VM and that each load is βx∗> x∗. Then, applying repeatedly Lemma 1 until 3m/4PMs are used, where `1and `2are the loads of any pair of VMs assigned to the same PM, a partition π0such that P(π0)≤P(π)can be obtained. If in π0some PM is assigned more than 2 VMs, then there exists another partition π00 where no PM is assigned more than 2 VMs with a power consumption that is not worse than P(π0). To 2For clarity we omit floors and ceilings in the proof.
4.4 Online Analysis 69 see why, consider the following reassignment procedure. Repeatedly until there is no such PM, locate a PM siwith at least 3 VMs. Then, locate a PM sjwith one single VM (which exists by the pigeonhole principle). Then, move one VM from sito sj. From Lemma 2 each movement decreases the power consumed. Hence, π00 is still a partition that uses 3m/4PMs, each PM has at most 2 VMs assigned, and P(π00)≤P(π0). Then, we know that P(π)is not smaller than the power consumption of a partition where exactly 3m/4PMs are used and no PM is assigned more than 2VMs. On the other hand, OPT would have assigned each VM to a different PM. Thus, using that x∗= (b/(α−1))1/α, the competitive ratio is ρ≥(2βx∗)αm/4+(βx∗)αm/2+3mb/4 m(βx∗)α+mb ≥(2α−2+ 1/2)βα βα+ (α−1) ≥2α−3+ 1/4, where the last inequality follows from βα≥(α−1). Finally, observe that 2α−3+ 1/4≥ 3α/(2α+2 +)for α > 1. No more VMs arrive in this case. Let us consider now the the case where ALG assigns the minitial VMs to more than 3m/4 PMs. Then, after ALG has assigned the first mVMs, a second batch of m/2VMs arrive, each VM with load 2βx∗. Let πbe the partition output by ALG after this second batch is assigned. If in πtwo of the second batch VMs are assigned to the same PM si, by the pigeonhole principle there is at least one PM sjwith at most load βx∗. Then, from Lemma 2, the power consumed is reduced if one of the new VMs is moved from sito sj. After repeating this process as many times as possible, a partition π0is obtained where each of the VMs of the second batch is assigned to a different PM, and P(π0)≤P(π). Since ALG used more than 3m/4PMs in the first batch, in π0, there are at least m/4PMs with load 3βx∗. On the other hand, OPT can distribute all the VMs in such a way that each PM has a load of 2βx∗. Thus, the bound on the competitive ratio is as follows. ρ≥m(3βx∗)α/4 m(2βx∗)α+mb ≥3α 2α+2 +, where the last inequality follows from ≥(α−1)/βα. Now, we show a stronger lower bound on the competitive ratio for (·,2)-VMA problem. Theorem 9. There exists an instance of problem (·,2)-VMA such that no online algorithm can guarantee a competitive ratio smaller than 3α/2α+1. Proof : We prove the result by showing an adversarial arrival of VM. We evaluate the competitive ratio of any online algorithm ALG with respect to an optimal algorithm OPT that knows the future VM arrivals. The adversarial arrival follows. In a first phase two VM d1and d2arrive, with loads `(d1) = `(d2)=6x∗(Recall from Section 4.2 that x∗= (b/(α−1))1/α).
70 Efficient Assignment of Virtual Machines to Physical Machines If ALG assigns both VMs to the same PM, the power consumed will be (12x∗)α+b, whereas OPT would assign them to different PMs, with a power consumption of 2((6x∗)α+b). Hence, the ratio ρwould be ρ=(12x∗)α+b 2((6x∗)α+b)>12α 2(6α+α−1) >12α 2(6α+ 2α)=6α 2(3α+ 1), where the first inequality follows from α > 1and the second from α−1<2αfor any α > 1. It is enough to prove that 6α/(2(3α+ 1)) ≥(3/2)α/2, or equivalently 4α≥3α+ 1, which is true for any α > 1. Then, there are no new VM arrivals. If, otherwise, ALG assigns each VM d1and d2to a different PM, then a third VM d3arrives, with load `(d3) = 12x∗. Then, ALG must assign it to one of the PMs. Independently of which PM is used, the power consumption of the final configuration is (18x∗)α+ (6x∗)α+ 2b. On its side, OPT assigns d1and d2to one PM, and d3to the other, with a power consumption of 2((12x∗)α+b). Hence, the competitive ratio ρis ρ=(18x∗)α+ (6x∗)α+ 2b 2((12x∗)α+b)>18α+ 6α 2(12α+α−1) >18α+ 6α 2(12α+ 4α)≥(3/2)α/2, where the first inequality follows from α > 1, the second from α−1<4αfor any α > 1, and the third from (9α+ 3α)/(6α+ 2α)≥(3/2)α, what can be checked to be true. Then, there are no new VM arrivals and the claim follows. 4.4.2 Upper Bounds Now, we study upper bounds for (·,·)-VMA, (C, ·)-VMA, and (·,2)-VMA problems. We start giving two online VMA algorithms, that we denote as VMA1 and VMA2 and that can be found in Algorithm 1 and Algorithm 2. We study algorithm VMA1 for both (·,·)-VMA and (C, ·)-VMA problems while VMA2 is only studied for the (·,·)-VMA case. These algorithms use the load of the new revealed VM in order to decide the PM where it will be assigned. The behaviour of both algorithms is similar. In algorithm VMA1, if the load of the revealed VM is strictly larger than min{x∗, C}/2, the algorithm assigns this VM to a new PM without any other VM already assigned to it. Otherwise, the algorithm schedules the revealed VM to any loaded PM whose current load is smaller or equal than min{x∗,C} 2. Hence, when this new VM is assigned, the load of this PM remains smaller than min{x∗, C}. If there is no such loaded PM, the revealed VM is assigned to a new PM. On the other hand, algorithm VMA2 shares the same behaviour but uses a different threshold. In this case, if the load of the revealed VM is strictly larger than min{x∗, C}, the algorithm assigns this VM to a new PM. If the load is smaller than x∗,VMA2 schedules the
4.4 Online Analysis 71 new VM to the most loaded PM whose load is smaller than x∗. Note that, since the case under consideration assumes the existence of an unbounded number of PMs, there exists always one new PM. As mentioned, a detailed description of these algorithms is shown in Algorithm 1 and Algorithm 2. As before, Ajdenotes the set of VMs assigned to PM sjat a given time. Algorithm 1: Online algorithm VMA1 for (·,·)-VMA and (C, ·)-VMA problems. for each VM dido if `(di)>min{x∗,C} 2then diis assigned to a new PM else diis assigned to any loaded PM sjwhere `(Aj)≤min{x∗,C} 2. If such loaded PM does not exist, diis assigned to a new PM. Algorithm 2: Online algorithm VMA2 for the (·,·)-VMA problem. for each VM dido if `(di)≥x∗then diis assigned to a new PM else diis assigned to the PM sjsuch that `(Ak)≤`(Aj)< x∗for all k. If such loaded PM does not exist, diis assigned to a new PM. 4.4.2.1 Upper Bounds for the (·,·)-VMA and (C, ·)-VMA problems We prove the approximation ratio of Algorithm 1 in the following two theorems. Theorem 10. There exists an online algorithm for (·,·)-VMA and (C, ·)-VMA when x∗< C that achieves the following competitive ratio: ρ= 1,if no VM dihas load such that `(di)< x∗, ρ≤1−1 α1−1 2α2 + x∗ `(Ds),otherwise. Proof : We proceed with the analysis of the competitive ratio of Algorithm 1 shown above. Let us first consider an optimal algorithm, that is, an algorithm that gives an optimal solution for any instance. Let us denote by π∗the optimal solution obtained by the optimal algorithm, and Aithe load assigned to PM siin that solution, for a particular instance of VMA problem. Furthermore, load Aiis decomposed in di1, di2, . . . , diki, where each dijis a VM that π∗assigns to si. Using simple algebra, it holds: f(`(Ai)) = f(`(Ai)) `(Ai)(`(di1) + `(di2) + · · · +`(diki)).
72 Efficient Assignment of Virtual Machines to Physical Machines It is possible now to split the set Aiin two sets, one with those VMs assigned to siwhose load is strictly smaller than x∗and a second set that contains those VMs assigned to siwhose load is bigger than x∗. In terms of notation, we say that Aiis split in Biand Si(where Bstands for Big loads and Sstands for Small loads). Therefore, it also holds: f(`(Ai)) = X dij∈Bi f(`(Ai)) `(Ai)`(dij) + X dij∈Si f(`(Ai)) `(Ai)`(dij). On the other hand, by definition of x∗, it holds that: f(`(Ai))/`(Ai)≥f(x∗)/x∗ for all i(indeed, for any load). Moreover, if a PM has been assigned with a load `(dij)bigger than x∗, it also holds that f(`(Ai))/`(Ai)≥f(`(dij))/`(dij). Hence, we obtain the following inequality: f(`(Ai)) ≥X dij∈Bi f(`(dij)) + X dij∈Si f(x∗) x∗`(dij). In order to lower bound the power consumption of the solution π∗, we plug the above inequality into the corresponding equation: P(π∗) = X Ai6=∅ f(`(Ai)) ≥X Ai6=∅X dij∈Bi f(`(dij)) + f(x∗) x∗X Ai6=∅X dij∈Si `(dij), or, equivalently expressed in more compact notation: P(π∗)≥X di:`(di)≥x∗ f(`(di)) + f(x∗) x∗X di:`(di)<x∗ `(di).(4.6) Consider now Algorithm 1. Let us denote by πa solution that Algorithm 1 gives for a particular instance. Also, let us denote by ˆ Aithe load assigned by Algorithm 1 to PM si. Note that due to the design of the algorithm, after the last VM has been assigned, either there is only one loaded PM whose current load is smaller than x∗/2, or every loaded PM has a load at least x∗/2. We study these two cases separately. Case 1: `(ˆ Ai)≥x∗/2for all i. In this case, in a solution provided by πthere are PMs with two types of load: those that are loaded with one VM whose load is no smaller than x∗, and those that
4.4 Online Analysis 73 are loaded with VMs whose load is strictly smaller than x∗, nonetheless, their total load is bigger than x∗/2. Note that due to the design of the algorithm, none of the PMs in the second group has a load bigger than x∗. Let us denote by Bthe set of VMs with load at least x∗, and Dsthe set of VMs with load less than x∗. Therefore, it holds: P(π) = X d∈B f(`(d)) + X x∗ 2≤`(ˆ Ai)≤x∗ f(`(ˆ Ai)) ≤X d∈B f(`(d)) + f(x∗ 2) x∗ 2 `(Ds). Computing the ratio ρbetween P(π)and P(π∗), we obtain the following inequality: ρ≤Pd∈Bf(`(d)) + f(x∗ 2) x∗ 2 `(Ds) Pd∈Bf(`(d)) + f(x∗) x∗`(Ds) ≤ f(x∗ 2) x∗ 2 `(Ds) f(x∗) x∗`(Ds) = 2f(x∗ 2) f(x∗)= 2 1−1 α1−1 2α. Case 2: there exists sisuch that `(ˆ Ai)< x∗/2. In this case, πgives solutions with three types of loaded PMs: those that are loaded with one VM whose load is bigger than x∗, those that are loaded with VMs whose load is strictly smaller than x∗, but which total load is at least x∗/2, and one PM whose total load is is strictly smaller than x∗/2. Let us denote such a PM by s0. Therefore, it holds: P(π) = X d∈B f(`(d)) + X x∗ 2≤`(ˆ Ai)≤x∗ f(`(ˆ Ai)) + f(`(ˆ As0)) ≤X d∈B f(`(d)) + f(x∗ 2) x∗ 2`(Ds)−`(ˆ As0)+f(`(ˆ As0)) =X d∈B f(`(d)) + f(x∗ 2) x∗ 2`(Ds)−`(ˆ As0)+`(ˆ As0)α+b. Let us denote the latter expression by Π(π). Computing the ratio ρbetween P(π)and P(π∗), we
80 Efficient Assignment of Virtual Machines to Physical Machines PMs they will be used. Otherwise all PMs will be used. Finally, the load Lis assigned among all used PMs as if it could be infinitely divided (i.e., as a fluid), using a water-filling algorithm [27]. We evaluate both (·, m)-VMA and (C, m)-VMA problems, therefore, in the (C, m)-VMA case a VM can only be assigned to a PM if the latter has sufficient capacity to host it. We test both algorithms VMA1 and VMA2 and also compare them with the following algorithms proposed in the literature: • Random Fit (RF) [74]: It chooses a PM for each VM uniformly at random among the PM. If the chosen PM cannot allocate the load of the VM, the process is repeated, until the VM is assigned to a PM. • Next Fit (NF) [74]: Starting initially at the first PM, each new VM is assigned to the next PM after the latest PM to which a VM was assigned (in a cyclic fashion) and with sufficient capacity to host it. • Least Full First (LFF) [74]: Each new VM is assigned to (one of) the least loaded PM(s) in the system with enough capacity to host it. • Striping (S) [63]: Each new VM is assigned to (one of) the PM(s) with the smallest number of VMs assigned and with enough capacity to host it. • Watts per Core (WC) [63]: Assigns each new VM to the PM whose power would suffer the smallest increase and with enough capacity to host it. • First Fit (FF) [74]: Starting initially at the first PM, each new VM is placed in the first PM that can host it. • Round Robin (RR) [63]: Like FF but, after the first VM is assigned, the search starts from the latest PM in which a VM was allocated. • Packing (P) [63]: Each new VM is assigned to (one of) the PM(s) with the largest number of VMs assigned provided that the PM can host it. • Most Full First (MFF) [74]: Each new VM is assigned to the most loaded PM in which it fits. Observe that, given its nature, First Fit, Round Robin, Packing and Most Loaded First can be only considered for the (C, m)-VMA problem. If PMs had infinite capacity, these algorithms would place all VMs in only one PM. The remaining algorithms are evaluated for both (·, m)- VMA and (C, m)-VMA. The behavior of the aforementioned algorithms is evaluated by inputting the two sets of traces, synthetic and real, shown in Figure 4.1. We call them Trace A and Trace B, respectively. Trace A is generated by randomly choosing the load of each VM following a power-law distribution with exponential cutoff, which has been chosen so 100% is the maximum task load of a VM.
4.5 Experimental Evaluation 81 (a) Trace A (synthetic traces) (b) Trace B (Google traces) Figure 4.1: VM load distributions used in the evaluations. We randomly select 10000 integer loads using this distribution. This leads us to the VM load distribution shown in Figure 4.1(a). Trace B is obtained from public Google traces [57]. We extract all the tasks from these traces, assuming that each task is an independent VM. The VMs (tasks) are sorted by the time at which they join the system. The task load of a VM is the maximum CPU load of the task. The trace then contains 124885 VMs with loads varying between 0.31% and 12.5%. The resulting VM load distribution can be seen in Figure 4.1(b). The load values of the VMs for both distributions are given in percentage in order to scale them up depending on the maximum capacity of a PM in the (C, m)-VMA case or to an appropriate value in the (·, m)-VMA case. Each execution of the algorithms is run with a fixed number of PMs. This number of PMs increases from 1to the number of VMs in the trace being used. This allows us to see how the power consumption and how the algorithms behavior evolve when the number of available PMs in the system varies. Finally, in order to evaluate both (·, m)-VMA and (C, m)-VMA, we emulate different PMs by determining their α,b,µand x∗parameters as well as the PM maximum capacity or the maximum task load when it corresponds. Then we run the proposed algorithms for each one of these emulated PMs and compare the influence of the different values for these parameters on the final results. 4.5.2 Experimental Results for (·, m)-VMA We first evaluate (·, m)-VMA. The first step is to define the set of PMs that we are going to use to evaluate it. To do so, we fix the values of α,band x∗and compute µdepending on the previous parameters. In particular, we used α={1.5,2,2.5,3}and x∗= {10,30,50,75,100,130,150,300,500,750,1000}(given in (Giga)Cycles per Second (GCPS) following the conclusions from Chapter 3). The values of bare determined by interpolation of the baseline costs of Nemesis,Survivor and Erdos, whose values for b(∼85 W, 67 W and 215 W) are known from the experiments performed in Chapter 3. As we mentioned, the values
82 Efficient Assignment of Virtual Machines to Physical Machines Table 4.3: Simulation parameters for a set of machines for the (·, m)-VMA case. (·,·)-VMA case b x∗[GCPS] α= 1.5α= 2 α= 2.5α= 3 73.05 10 1.46E-13 7.31E-19 4.87E-24 3.65E-29 92.15 30 3.55E-14 1.02E-19 3.94E-25 1.71E-30 111.25 50 1.99E-14 4.45E-20 1.33E-25 4.45E-31 135.125 75 1.32E-14 2.40E-20 5.85E-26 1.60E-31 159 100 1.01E-14 1.59E-20 3.35E-26 7.95E-32 187.65 130 8.01E-15 1.11E-20 2.05E-26 4.27E-32 206.75 150 7.12E-15 9.19E-21 1.58E-26 3.06E-32 350 300 4.26E-15 3.89E-21 4.73E-27 6.48E-33 541 500 3.06E-15 2.16E-21 2.04E-27 2.16E-33 779.75 750 2.40E-15 1.39E-21 1.07E-27 9.24E-34 1018.5 1000 2.04E-15 1.02E-21 6.79E-28 5.09E-34 of b,αand x∗determine the value of µ. These combination of parameters results in 44 different instances of PMs which are shown in Table 4.3. Additionally, taking advantage of the fact that the task loads from Trace A and B are given in percentage, and in order to study the importance of the x∗to task load ratio, we define the maximum VM load λas the maximum load that a VM arriving to the system can have. Therefore, the load of the VMs arriving to the system will be the product of the task load (in percentage) and λ.λwill take the following values: 10,30 and 100 GCPS. We study three different scenarios. In the first one we study the effect of αfor different values of λand x∗when using VMA1,VMA2, and the lower bound LBVMA. Second and third scenarios are devoted to compare our proposed algorithms with the state-of-the-art algorithms, always keeping LBVMA as a reference. In the second scenario we study the relevance of λwhile keeping αand x∗constant. Finally, in the third one, we study the effect of having different values of x∗while λand αremain unaltered. Scenario 1compares the power consumed by partitions obtained with VMA1 or VMA2 and for Trace A and Trace B. We compare these results to the ones achieved by LBVMA, that lower bounds the optimal power consumption. The results obtained are presented as graphs in which the power consumed is represented as a function of the number of PMs used. Figure 4.2 and Figure 4.3 show the results for Trace Aand Trace B, for 2different values of x∗,30 and 300 GCPS, and 2different values of λ,10 and 100 GCPS. We can clearly see how the power consumption is smaller for larger values of αonce the optimal number of used PMs is reached, mainly conditioned by how µdecreases as αincreases (See Table 4.3. Also, as it can be observed, there is no qualitative difference in the solutions when αvaries for a given configuration (Similar results are obtained with other values of x∗and maximum task load). Regarding the performance of the algorithms, we can see how the power consumed by the partitions found with VMA2 is lower, in all cases, than the ones obtained by VMA1 and is always
4.5 Experimental Evaluation 83 (a) 10 GCPS, x∗= 30 GCPS (b) 10 GCPS, x∗= 300 GCPS (c) 100 GCPS, x∗= 30 GCPS (d) 100 GCPS, x∗= 300 GCPS Figure 4.2: (·, m)-VMA: Comparing the power consumed by VMA1 and VMA2 with the lower bound LBVMA for x∗={30,300}GCPS, α={1.5,2.5}and λ={10,100}GCPS for Trace A (Synthetic traces). closer to the lower bound obtained by LBVMA. This shows that the performance of VMA2 is close to the optimal for (·, m)-VMA. We can see how, in general, VMA1 is able to match the results of VMA2 when the number of PMs is relatively low. However, due to the threshold imposed on the load of the PMs for each algorithm, VMA2 is able to pack the load in less PMs. We only find an exception in Figure 4.2(c), when x∗/λ < 1/3and we are using synthetic traces. In this case VMA2 exhibits a behavior relatively similar to VMA1, not being able to hold to its best power consumption and reducing the quality of the solution when the number of PMs increases. However, this flaw is not replicated when using Trace B, due to the smaller amount of big loads in comparison with Trace B. Scenario 2compares the performance of LBVMA,VMA1 and VMA2 with the other assignment algorithms proposed in the literature. Here, the values of x∗and αare fixed to 30 GCPS and 2, respectively, while the value of λvaries. In particular we use λ={10,30,100}GCPS. Figures
84 Efficient Assignment of Virtual Machines to Physical Machines (a) 10 GCPS, x∗= 30 GCPS (b) 10 GCPS, x∗= 300 GCPS (c) 100 GCPS, x∗= 30 GCPS (d) 100 GCPS, x∗= 300 GCPS Figure 4.3: (·, m)-VMA: Comparing the power consumed by VMA1 and VMA2 with the lower bound LBVMA for x∗={30,300}GCPS, α={1.5,2.5}and λ={10,100}GCPS for Trace B (Google traces). 4.4 and 4.5 present the results for Trace A and Trace B3. We can easily see, in general, 3different trends in Figures 4.4 and 4.5. The first trend would include LBVMA,VMA1 and VMA2; then we have a second one including Striping,RF,NF and LLF; and, finally, in some sort of no-man’s land, we have WC. These trends have their origin in power awareness. While LBVMA,VMA1,VMA2 and WC are power aware, the rest are not. According to Figures 4.4 and 4.5, power aware algorithms outperform the non power aware ones. It is interesting to see how WC reduces its power consumption (for Trace A) as the ratio x∗/λ decreases and even performs better than VMA1 for λ= 100 GCPS. This does not happen, though, for Trace B due to the smaller average task load, that gives advantage to VMA1 and VMA2. With Trace B, due to its nature, WC obtains partitions that use less PMs and hence, because of the 3For the sake of clarity, we do not show the power consumption resulting of using only one (or a few) machines and center the figure into more relevant cases
4.5 Experimental Evaluation 85 (a) λ= 10 GCPS (b) λ= 30 GCPS (c) λ= 100 GCPS Figure 4.4: (·, m)-VMA: Comparing the power consumed by the different assignment algorithms for x∗= 30 GCPS, α= 2 and λ={10,30,100}GCPS for Trace A (Synthetic traces).
86 Efficient Assignment of Virtual Machines to Physical Machines (a) λ= 10 GCPS (b) λ= 30 GCPS (c) λ= 100 GCPS Figure 4.5: (·, m)-VMA: Comparing the power consumed by the different assignment algorithms for x∗= 30 GCPS, α= 2 and λ={10,30,100}GCPS for Trace B (Google traces).
4.5 Experimental Evaluation 87 superlinear dependence of the power consumption on the load, have higher power consumptions. Similarly, we can observe that the results in Figure 4.4(c) are tighter. This is a consequence, again, of the low value of x∗/λ, resulting in many PMs not allocating more than 1or 2VMs. In fact, steady state for VMA1,VMA2,WC and even LBVMA is reached between the 4000 and the 5000 PMs while in the previous cases was reached before the 2000 PMs. Again, this behavior is not replicated with Trace B due to its lower average task load. Note also that the non power aware algorithms pay a higher power bill due to the use of a larger amount of PMs (in general) with a smaller amount of load per PM, resulting in a very inefficient usage of the available resources. This behavior is consistent for both Traces A and B. Finally, observe how the larger the ratio x∗/λ, the larger the gap between our proposed algorithms, VMA1 and VMA2, and the other ones. This would be the case when we have tasks that consume a very small amount of CPU in the system. Let us now analyze the results of the last scenario. Here we keep λ= 30 GCPS and α= 2 constant while we vary the value of x∗. These results are shown in Figure 4.6 for Trace A and in Figure 4.7 for Trace B. The results are similar for both traces. We can see how for the smallest value, x∗= 10 GCPS (x∗/λ = 1/3) all algorithms achieve a similar result. As the ratio x∗/λ increases, the results obtained by VMA1 and VMA2 become better than the ones achieved by WC,LLF,NF,Striping, and RF, that increase with x∗and, therefore, lead to a larger power consumption. These results are in line with the results from Scenario 1 and are is motivated by the fact that the state-of-the-art algorithms tend to use a large amount of PMs keeping its average load low and, hence, paying a high price because of the bparameter. This, however, is not the case of WC, which, on the other hand, obtains a more packed partition, loading PMs beyond x∗and paying an extra cost due to the superlinearity of the power consumption with respect to the load. 4.5.3 Experimental Results for (C, m)-VMA As we did with (·, m)-VMA in Subsection 4.5.2, we start by defining the set of PMs we are going to work with. While for (·, m)-VMA we assumed that PMs had infinite capacity, in (C, m)- VMA the PMs capacity is bounded. We denote the capacity as C. We define 3sets of instances that we name after 3real PMs from our laboratory, Nemesis,Euler, and Erdos. We use, as a reference, their maximum capacity, 11.2,41.6, and 153.6GCPS; and approximated idle cost b, 80,100, and 200 Watts. Jointly with Cand b, we need a value of αand x∗to compute each value of µ. We will use α={1.5,2,2.5,3}, and x∗={0.5,0.65,0.75,0.9,1,1.1} · C. We can now compute the value of µfor each combination of these 4parameters fully defining, then, our set of PMs. The combination of values for each one of these PM instances can be found in Tables 4.5, 4.6 and 4.4. We base the performance analysis of our proposed algorithms and the other state of the art assignment algorithms on these sets of PM instances. Like for the (·, m)-VMA case, we also consider three different scenarios. In the first one we
88 Efficient Assignment of Virtual Machines to Physical Machines (a) x∗= 10 GCPS (b) x∗= 100 GCPS (c) x∗= 30 GCPS (d) x∗= 300 GCPS (e) x∗= 50 GCPS (f) x∗= 500 GCPS Figure 4.6: (·, m)-VMA: Comparing the power consumed by the different assignment algorithms for λ= 30 GCPS, α= 2 and increasing values of x∗for Trace A (Synthetic traces).
4.5 Experimental Evaluation 89 (a) x∗= 10 GCPS (b) x∗= 100 GCPS (c) x∗= 30 GCPS (d) x∗= 300 GCPS (e) x∗= 50 GCPS (f) x∗= 500 GCPS Figure 4.7: (·, m)-VMA: Comparing the power consumed by the different assignment algorithms for λ= 30 GCPS, α= 2 and increasing values of x∗for Trace B (Google traces).
96 Efficient Assignment of Virtual Machines to Physical Machines (a) b= 80 W, x∗= 0.65 ·C(b) b= 80 W, x∗= 0.9·C (c) b= 100 W, x∗= 0.65 ·C(d) b= 100 W, x∗= 0.9·C (e) b= 120 W, x∗= 0.65 ·C(f) b= 120 W, x∗= 0.9·C Figure 4.13: (C, m)-VMA: Comparing the power consumed by the different assignment algorithms for C= 41.6GCPS, α= 2 and 2different values of x∗for Trace B (Google traces).
4.6 Discussion 97 reason for these results is basically a limitation of our model when trying to emulate different PMs changing only the value of b. In this case, as µdepends also on babsorbs the changes on its value, resulting in an identical behavior when x∗is kept constant. The results are, therefore, similar to the ones achieved in the second scenario. 4.6 Discussion We discuss in this section practical issues that must be addressed to apply our results to production environments. Heterogeneity of Servers. For the sake of simplicity, we assume in our model that all servers in a data center are identical. We believe this is reasonable, considering that modern data centers are usually built with homogeneous commodity hardware. Nevertheless, the proposed model and derived results are also amenable to heterogeneous data center environments. In a heterogeneous data center, servers can be categorized into several groups with identical servers in each group. Then, different types of applications can be assigned to server groups according to their resource requirements. The VMA model presented here can be applied to the assignment problem of allocating tasks from the designated types of applications (especially CPU-intensive ones) to each group of servers. The approximation results we derive in this paper can be then combined with server-group assignment approximation bounds (out of the scope of our work) for energy-efficient task assignment in real data centers, regardless of the homogeneity of servers. Consolidation. Traditionally, consolidation has been understood as a bin packing problem [75,95], where VMs are assigned to PMs attempting to minimize the number of active PMs. However, the results we derived in this chapter, as well as the results shown in Chapter 3, show that such approach is not energy-efficient. Indeed, we showed that PM’s should be loaded up to x∗to reduce energy consumption, even if this requires having more active PMs. VM arrival and departure. When a new VM arrives to the system, or an assigned VM departs, adjustments to the assignment may improve energy efficiency. Given that the cost of VM migration is nowadays decreasing dramatically, our offline positive results can also be accommodated by reassigning VMs whenever the set of VM demands changes. Should the cost of migration be high to reassign after each VM arrival or departure, time could be divided in epochs buffering newly arrived VM demands until the beginning of the next epoch, when all (new and old) VMs would be reassigned (if necessary) running our offline approximation algorithm. Multi-resource scheduling. This work focuses on CPU-intensive jobs (VMs) such as MapReduce-like tasks [39] which are representative in production datacenters. As the CPU is generally the dominant energy consumer in a server, assigning VMs according to CPU workloads entails energy efficiency. However, there exist types of jobs demanding heavily other computational resources, such as memory and/or storage. Although these resources have limited impact on a server’s energy consumption, VMs performance may be degraded if they become the bottleneck resource in the system. In this case, a joint optimization of multiple resources (out of the
98 Efficient Assignment of Virtual Machines to Physical Machines scope of our work) is necessary for VMA. Implementation on real systems. Most of the allocation algorithms that we have tested in Section 4.5 are already available in popular cloud platforms like OpenNebula [84] or Eucalyptus [44]. Including another allocation policy, such as our algorithms, in the cloud controllers of these and other platforms (e.g. Apache Mesos [12]) is feasible. Introducing our algorithms would make those platforms power efficient, providing power-aware allocation policies. This feature is not found on any of the algorithms tested in Section 4.5 except for the Watts per Core algorithm from [63]. We leave such integration for future work. 4.7 Conclusions In this chapter, we have studied a particular case of the generalized assignment problem with applications to Cloud Computing. We have considered the problem of assigning virtual machines (VMs) to physical machines (PMs) so that the power consumption is minimized, a problem that we call virtual machine assignment (VMA). In our theoretical analysis, we have shown that the decision version of (C, m)-VMA problem is strongly NP-complete. We have shown as well that the (C, ·)-VMA, (·, m)-VMA and (·,·)-VMA problems are strongly NP-hard. Hence, there is no FPTAS for these optimization problems. We have shown the existence of a PTAS that solves the (·,·)-VMA and (·, m)-VMA offline problems. On the other hand, we have proved lower bounds on the approximation ratio of the (C, ·)-VMA and (C, m)-VMA problems. With respect to the online version of these problems, we have proved upper and lower bounds on the competitive ratio of the (·,·)-VMA, (C, ·)-VMA, (·, m)-VMA, and (C, m)-VMA problems.
Chapter 5 Conclusions Cloud computing is alive and probably no more than a toddler yet. However, even in this early age we are already able to see many of the advantages, surely not all, that cloud computing can offer us. Despite of all these advantages we must not forget about its drawbacks and this was one of the targets of this master thesis. The main objective of this master thesis was to face one of the main problems of data centers, energy consumption, which was introduced in Part I. Reducing the costs associated to this issue is not only an economical target but also an environmental problem. Power is generated at a cost and, indefinitely increasing our power consumption will have a prejudicial effect on our world. It is our duty, as researchers, to care about sustainability and ensure that future times will be better. For these reasons we tried to provide of tools to directly or indirectly tackle these problems. This master thesis presents our contributions to the field of energy consumption in data centers. We studied how to reduce power consumption by optimizing how virtual machines are placed in physical machines, the virtual machine assignment problem; and also studied how servers consume power and energy in a data center, characterizing the contribution of each component and confirming the superlinearity on the load that we assumed in the virtual machine assignment problem. Starting with servers, in Chapter 3 we characterized how different components of a data center server consumes power. One of the most interesting aspects, and also differentiator from previous works, is how we studied the effect of having multiple cores and how varying their frequency affects, not only to their energy consumption, but also to other components. The main idea to be extracted here is that a server is a puzzle, where each piece is a component, and some pieces needed others to perform a task, thus, being affected by how those other pieces are being operated. This study throw very interesting results as clearly confirming the superlinearity of power consumption on the load in the server as well as showing that the Active Cycles per Second are a proper unit to measure the load in a server. We concluded this part of the study showing how the characterization of these components can be used to predict the energy consumption of an application from its profiling. 99
100 Conclusions Then, taking advantage of some of the conclusions of the previous chapter, as the superlinearity of the power consumption on the load, we studied the virtual machine assignment problem and how such a superlinear power consumption model affects it. We thoroughly analyzed four different cases, depending on whether the capacity and the number of the servers where bounded or not. For each one of them, when possible, we provided upper and lower bounds on the approximation ratio, as well as upper and lower bounds on the competitive ratio of the algorithms we proposed for them. We also proved, by simulation, that the algorithms we proposed can obtain substantially cheaper solutions, from the point of view of power consumption of the system, than other algorithms proposed in the literature. In general we proved that huge amounts of energy can still be saved in data centers with no need of updating the already deployed hardware, in some cases, and that new solutions are waiting for the new generation of servers and network devices, ready to optimize the way energy is used in data centers. 5.1 Future Work and Open Problems As we said at the beginning of this section, Cloud Computing is still a toddler. This means that the amount of open problems is practically unlimited and that, usually, an answer bring up two more questions. Allow us, then, to focus only in the particular issues that we have worked at during this master thesis. We are aware that the characterization of power consumption we presented in Chapter 3 is neither complete nor perfect. However, this is a key problem because the more accurately can we predict the power required by a server in a particular situation or the energy it will consume when a certain application is run, the better we will be able to assign tasks to servers or maneuver in case moving virtual machines across our servers is needed in order to increase the efficiency of our data center. In any case, we believe that some of the aspects we have proposed here will be helpful for future works. The most obvious open problems in this case are, first, to properly characterize the power consumption due to the RAM and, second, improve power characterizations so the accuracy is increased. Finally, regarding the virtual machine assignment problem presented in Chapter 4, our future work will consider the possibility that the load incurred by a VM changes over time or that the assignment of VMs to PMs is not final (and VMs can migrate, maybe at a cost). In fact, if the migration of VMs is available for free, our offline positive results can also be used in these new models, since an offline approximation algorithm can be run each time a load changes or a new VM arrives. Then, the VMs can be redistributed accordingly. Another future extension of the model will consider that the power consumption of a feasible solution of the VMA problem depends on several parameters simultaneously (e.g., memory space or communication bandwidth, in addition to processing load). Finally, as stated in Section 3.5, we plan to deploy our algorithm in a cloud platform, probably OpenNebula, and compare the performance of our proposed algorithms
5.1 Future Work and Open Problems 101 against other state-of-the-art allocation algorithms such as the ones analyzed in Section 4.5.
References [1] Amazon web services. http://aws.amazon.com. Accessed August 27, 2012. [2] Citrix. http://www.citrix.com. Accessed August 27, 2012. [3] Infiniband. http://www.infinibandta.org. [4] Rackspace. http://www.rackspace.com. Accessed August 27, 2012. [5] Gerald Aigner and William H Whitted. Modular data center, October 9 2007. US Patent 7,278,273. [6] Mohammad Al-Fares, Alexander Loukissas, and Amin Vahdat. A scalable, commodity data center network architecture. In ACM SIGCOMM Computer Communication Review, volume 38, pages 63–74. ACM, 2008. [7] Noga Alon, Yossi Azar, Gerhard J. Woeginger, and Tal Yadid. Approximation schemes for scheduling. In Michael E. Saks, editor, SODA, pages 493–500. ACM/SIAM, 1997. [8] Noga Alon, Yossi Azar, Gerhard J Woeginger, and Tal Yadid. Approximation schemes for scheduling on parallel machines. Journal of Scheduling, 1(1):55–66, 1998. [9] Matthew Andrews, Antonio Fern´ andez Anta, Lisa Zhang, and Wenbo Zhao. Routing for power minimization in the speed scaling model. IEEE/ACM Trans. Netw., 20(1):285–294, 2012. [10] Matthew Andrews, Spyridon Antonakopoulos, and Lisa Zhang. Minimum-cost network design with (dis)economies of scale. In Proc. of 51-st Annual IEEE Symposium on Foundations of Computer Science, pages 585–592, 2010. [11] Antonio Antoniadis, Sungjin Im, Ravishankar Krishnaswamy, Benjamin Moseley, Viswanath Nagarajan, Krik Pruhs, and Cliff Stein. Hallucination helps: Energy efficient circuit routing. In Erlebach and Persiano [43]. [12] Apache. Apache mesos. http://http://mesos.apache.org/, 2014. Accessed December 11th, 2014. 103
104 REFERENCES [13] M Bailey, M Eastwood, T Grieser, L Borovick, V Turner, and RC Gray. Special study: Data center of the future, 2007. [14] Jayant Baliga, Robert WA Ayre, Kerry Hinton, and Rodney S Tucker. Green cloud computing: Balancing energy in processing, storage, and transport. Proceedings of the IEEE, 99(1):149–167, 2011. [15] Nikhil Bansal, Ho-Leung Chan, and Kirk Pruhs. Speed scaling with an arbitrary power function. In Proc. of 20-th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 693–701, 2009. [16] Nikhil Bansal, Anupam Gupta, Ravishankar Krishnaswamy, Viswanath Nagarajan, Kirk Pruhs, and Cliff Stein. Multicast routing for energy minimization using speed scaling. In MedAlg, pages 37–51, 2012. [17] Luiz Andr´ e Barroso and Urs H¨ olzle. The case for energy-proportional computing. IEEE Computer, 40(12):33–37, 2007. [18] Luiz Andr´ e Barroso and Urs H¨ olzle. The datacenter as a computer: An introduction to the design of warehouse-scale machines. Synthesis lectures on computer architecture, 2009. [19] Luiz Andr´ e Barroso and Urs H¨ olzle. The datacenter as a computer: An introduction to the design of warehouse-scale machines, 2nd edition. Synthesis lectures on computer architecture, 2013. [20] Robert Basmadjian, Nasir Ali, Florian Niedermeier, Hermann de Meer, and Giovanni Giuliani. A methodology to predict the power consumption of servers in data centres. In ACM e-Energy, pages 1–10, 2011. [21] Robert Basmadjian and Hermann de Meer. Evaluating and modeling power consumption of multi-core processors. In Third International Conference on Future Energy Systems: Where Energy, Computing and Communication Meet (e-Energy), pages 1–10. IEEE, 2012. [22] CL Belady. Projecting annual new datacenter construction market size. Microsoft, Global Foundation Services Report, 2011. [23] Umesh Bellur, Chetan S. Rao, and Madhu Kumar SD. Optimal placement algorithms for virtual machines. CoRR, abs/1011.5064, 2010. [24] Anton Beloglazov, Jemal Abawajy, and Rajkumar Buyya. Energy-aware resource allocation heuristics for efficient management of data centers for cloud computing. Future Generation Computer Systems, 28(5):755–768, 2012. [25] Bruno Biais and Paul Woolley. High frequency trading. Manuscript, Toulouse University, IDEI, 2011.
REFERENCES 105 [26] Juan Felipe Botero, Xavier Hesselbach, Michael Duelli, Daniel Schlosser, Andreas Fischer, and Hermann de Meer. Energy efficient virtual network embedding. IEEE Communications Letters, 16(5):756–759, 2012. [27] Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, New York, NY, USA, 2004. [28] Alaa Brihi and Waltenegus Dargie. Dynamic voltage and frequency scaling in multimedia servers. In IEEE AINA, 2013. [29] M. Cardosa, A. Singh, H. Pucha, and A. Chandra. Exploiting spatio-temporal tradeoffs for energy-aware mapreduce in the cloud. In Cloud Computing (CLOUD), 2011 IEEE International Conference on, pages 251 –258, 2011. [30] P Castagna. Having fun with pagerank and mapreduce. Hadoop User Group UK talk. Available: http://static. last. fm/johan/huguk-20090414/paolo castagna-pagerank. pdf. [31] Deeparnab Chakrabarty, Chandra Chekuri, Sanjeev Khanna, and Nitish Korula. Approximability of capacitated network design. In IPCO, pages 78–91, 2011. [32] Ashok K. Chandra and C. K. Wong. Worst-case analysis of a placement algorithm related to storage allocation. SIAM J. Comput., 4(3):249–263, 1975. [33] Jeffrey S Chase, Darrell C Anderson, Prachi N Thakar, Amin M Vahdat, and Ronald P Doyle. Managing energy and server resources in hosting centers. In ACM SIGOPS Operating Systems Review, volume 35, pages 103–116, 2001. [34] Shih-Chang Chen, Chih-Chun Lee, Hsi-Ya Chang, Kuan-Chou Lai, Kuan-Ching Li, and Chunming Rong. Energy-aware task consolidation technique for cloud computing. In Proceedings of the IEEE Third International Conference on Cloud Computing Technology and Science, pages 115–121, 2011. [35] Susanta Nanda Tzi-cker Chiueh and Stony Brook. A survey on virtualization technologies. RPE Report, pages 1–42, 2005. [36] Michael Chlistalla, Bernhard Speyer, Sabine Kaiser, and Thomas Mayer. High-frequency trading. Deutsche Bank Research, pages 1–19, 2011. [37] R. A. Cody and Edward G. Coffman Jr. Record allocation for minimizing expected retrieval costs on drum-like storage devices. J. ACM, 23(1):103–115, 1976. [38] Standard Performance Evaluation Corporation. Spec power benchmark, 2007. [39] Jeffrey Dean and Sanjay Ghemawat. Mapreduce: simplified data processing on large clusters. Commun. ACM, 51(1):107–113, 2008.