Energy Aware Consolidation Algorithm Based on K ... - IEEE Xplore

2 downloads 8401 Views 325KB Size Report
K-nearest Neighbor Regression for Cloud Data Centers. Fahimeh ... resource usage in each host. ... solutions to optimize resource usage and reduce energy.
2013 IEEE/ACM 6th International Conference on Utility and Cloud Computing

Energy Aware Consolidation Algorithm based on K-nearest Neighbor Regression for Cloud Data Centers Fahimeh Farahnakian, Tapio Pahikkala, Pasi Liljeberg, and Juha Plosila Department of Information Technology, University of Turku Turku, Finland {fahfar, aatapa, pakrli, juplos}@utu.fi have formulated as an optimization problem [3][4]. Although an optimization problem is associated with constraints like data center capacity and SLA. Therefore, these works utilize a heuristic method for the multidimensional bin packing problem as an algorithm for the workload consolidation. Data centers are bins and VMs are objects, with each data center being one dimension of the size. Algorithms solve this problem to minimize the number of bins while packing all the objects. In addition, the VirtualPower architecture [5] utilizes a power management system based on local and global policies. On the local level, the system leverages guest operating system’s power management strategies. Global policy applies VMs live migration to reallocate the VMs. In a previous work [6], we utilized linear regression to predict an under-loaded or overloaded host. Experiments show that the prediction method can significantly reduce the energy consumption and SLA violation rates. In this paper, we proposed a dynamic consolidation algorithm where the main contributions of the paper are summarized as follow: 1. Predicting short-term of future utilization in each host. We use KNN to forecasts future resources demands based on historical data about resource usage which is collected during the lifetime of host as a training dataset. 2. Improving the dynamic VM consolidation performance in cloud data center by using prediction utilization method. An efficient VM consolidation method migrates VMs commensurate with the current and future requests. Therefore the proposed dynamic consolidation algorithm uses the K-nearest neighbor regression for predicting overutilized and under-utilized hosts.

Abstract— In this paper, we propose a dynamic virtual machine consolidation algorithm to minimize the number of active physical servers on a data center in order to reduce energy cost. The proposed dynamic consolidation method uses the k-nearest neighbor regression algorithm to predict resource usage in each host. Based on prediction utilization, the consolidation method can determine (i) when a host becomes over-utilized (ii) when a host becomes under-utilized. Experimental results on the real workload traces from more than a thousand PlanetLab virtual machines show that the proposed technique minimizes energy consumption and maintains required performance levels. Keywords- Cloud computing; energy efficiency; green IT; dynamic consolidation; k-nearest neighbor regression

I. INTRODUCTION As energy consumption of ICT infrastructures has increased considerably in the recent years, the research community and companies are working on energy-aware resource management strategies. A 3% reduction in energy cost for a large company like Google can translate into over a million dollars in cost savings [1]. Moreover, high power consumption by the data center leads to substantial carbon dioxide (CO2) emissions contributing to the greenhouse effect. Dynamic consolidation is one of the most promising solutions to optimize resource usage and reduce energy consumption in virtualization technology [2]. It switches the idle hosts to the sleep mode to eliminate the idle power consumption after Virtual Machine (VM) consolidation. In this paper, we proposed a dynamic consolidation algorithm that minimizes the number of active hosts according to the current and future resource usage. Moreover, to forecast the future CPU usage in each host, a prediction method based on k-nearest neighbor algorithm is presented. The rest of this paper is organized as follows: Section II reviews the related work. The k-nearest neighbor regression is explained in Section III. The proposed prediction method and dynamic consolidation algorithm are described in Section IV and Section V, respectively. The results are given in Section VI while we summarize and conclude in the last section.

III. K-NEAREST NEIGHBOR REGRESSION Suppose the training dataset has m samples that each sample xi is described byy n input p variables and an output variable yi such as . The goal is to learn a function known as a regression function that model the relationship between input variables and an output variable. The KNN regression estimates the function by taking a local average of the training dataset. Locality is defined in terms of the k samples nearest to the estimation sample. As the performance of KNN algorithm strongly depends on the parameter k, finding the best values of k is essential. A large k value decreases the effect of noise and minimizes the prediction losses. However, a small k value allows simple implementation and efficient queries [7][8]. Cross validation can employ to estimate the accuracy and validity of the classifier with different k values [8]. Two common schemes of cross validation are m-fold cross-

II. RELATED WORK There is an extensive amount of proposals on virtualization technology that relates to dynamic VM consolidation, and the most recent techniques aim to reduce energy consumption while meeting performance requirements. In some approaches, the VM consolidation 978-0-7695-5152-4/13$26.00 CFP13UCC-USB/13 $26.00©©2013 2013IEEE IEEE DOI 10.1109/UCC.2013.51

256

is selected in step 2. Finally, the output value of estimated in step 3 by computing the mean of the label values of its k nearest neighbors.

validation and Leave-One-Out Cross-Validation (LOOCV). In m-fold cross-validation, the dataset is randomly divided into m subsets or folds and repeated m times. Each time, one fold is reserved as a test dataset for validating the model and the remaining m-1 folds are used for training the model as a training dataset. Then, the classification accuracy across all m trails is computed. LOOCV is a particular type of mfold cross-validation where m is the number of examples in the dataset. As the size of the dataset is not large, LeaveOne-Out Cross-Validation (LOOCV) is utilized in this paper.

Algorithm 1– KNN-UP algorithm Input: host, dataset (X) with m samples Output: predictedUtil // Find the best value for k with LOOCV 1. for k=1 to m do 2. loss[k] Å 0 3. for i=1 to m do 4. TestSampleÅ xi 5. TrainingDataset Å X-{xi} 6. i Å KNN(TestSample, TrainingDataset, k) 7. loss[k] Å loss[k]+pow((( i-yi),2) 8. kbest Å argmink loss[k] // Predict the utilization with KNN 9. predictedUtilÅ KNN (currentUtil(host), kbest) 10. return predictedUtil

IV. KNN-BASED UTILIZATION PREDICTION ALGORITHM In order to meet SLA availability guarantee and efficient resources utilization, a prediction method is proposed to forecasts the future utilization and named KNN-based Utilization Prediction (KNN-UP). It predicts the CPU utilization by a function approximation based on historical data of usage. So, the training dataset is gathered on the real workload for each host during the simulation time. Real workload data is provided as a part of the CoMon project, a monitoring infrastructure for PlanetLab [9]. In this project, the CPU utilization data is obtained from more than a thousand VMs from servers located at more than 500 places around the world. Data is collected every five minutes and is stored in a variety of files. We selected five days from the workload traces collected during April 2011 of the project. During the simulation, each VM is randomly assigned a workload trace from one of the VMs from the corresponding day. Table 1 shows the number of VMs that are considered for each day.

Algorithm2 –KNN algorithm Input: query- sample (xq), training dataset, number of nearest neighbors (k) Output: the label of sample xq ( 1. for j=1 to m do // Step1 2. distance[j] Å 0 3. for i=1 to n do{ 2 4. distance[j] Å distance[j] +( xqi-xji) distance[j]Å Sqrt (distance[j]) 5. 6. // Sort distance array 7. for i=1 to k do // Step2 8. nearestSet [i]=distance[i] 9. sum Å 0 // Step 3 10. for all z do 11. sum Å sum+yz 12. Å sum / k 13. return

Table 1. The number of VMs in the real workload 3.4 9.4 11.4 12.4 20.4 No.VMs 1463 1463 1463 1463 1463 Date

V. DYNAMIC CONSOLIDATION ALGORITHM Consider a large-scale data center as a resource provider that consists of N heterogeneous physical servers (hosts). Several users submit requests for provisioning of M VMs which are allocated the N hosts. Initially, the VMs are allocated according to the requested characteristics assuming 100% CPU utilization. The VMs experience dynamic workloads, which mean that the CPU usage by a VM arbitrarily varies over time. In this paper, we present a dynamic consolidation method that employs the KNN-UP to predict the short-term future utilization, and called Dynamic Consolidation based on K-Nearest Neighbor (DC-KNN). We split the dynamic consolidation into four algorithms to achieve SLA violation and energy cost reduction targets: 1) Over-utilized host prediction: the host becomes overutilized if the prediction utilization value is greater than the available CPU capacity. 2) VM selection: choosing which VMs should be migrated from the under-utilized or over-utilized host. 3) VM allocation: selecting a host for allocating the selected VMs from the under-utilized or over-utilized host. 4) Under-utilized host prediction: a host becomes underutilized while the sum of future and current utilization is smaller than 10% of total hosts utilization.

Each sample of training dataset consists of seven input variables and an output variable. The inputs show the total utilization values of all VMs on a host during past 30 minutes (Ut-5,…, Ut-30) and current time (Ut). These values are significant for forecasting the short-term utilization. The output value indicates host utilization after five minutes (Ut+5). Since the workload nature is dynamic, KNN-UP considers only 100 last samples of the training dataset (Algorithm 1). First, KNN-UP finds the best value of k between one and the number of samples with LOOCV (line 1-10). For each possible value of k, a sample of the dataset is selected as a test sample and remaining samples are used as a training dataset (line 4 and 5). Then, the Algorithm 2 predicts the label of test sample (line 6). The prediction accuracy is estimated by summing up the losses values for each k value (line 7). The best k value with minimum total loss is chosen (line 10). Finally, it forecasts the host utilization according to the k nearest samples through KNN (line 11). Algorithm 2 describes the KNN method based on three steps. In step1, the distance array between and all other samples in the training dataset is calculated based on Euclidean distance. Then, the k nearest neighbors of x q are

257

Table 2. The power consumption at different load levels in Watts Server

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

HP ProLiant G4

86

89.4

92.6

96

99.5

102

106

108

112

114

100%

117

HP ProLiant G5

93.7

97

101

105

110

116

121

125

129

133

135

1) Average SLA Violation Percentage As QoS requirements are commonly defined in term of SLAs, we considered the average SLA violation percentage metric to compare the efficiency of the algorithms. The metric represents the percentage of average CPU performance that has not been allocated to an application when requested, resulting in performance degradation [10]. It is calculated by Equation (3) as a fraction of the difference between the requested by all VMs (Urj(t)) and the actually allocated MIPS (Uaj(t)) relatively to the total requested MIPS over the life-time of the VMs ,where M is the number of VMs.

The dynamic consolidation mechanism continuously runs these algorithms in two phases to ensure that the proposed goals are match all time. In the first phase, all hosts on the data center checks with Over-utilized host prediction algorithm. To avoid SLA violation, the VM selection algorithm selects VMs to be migrated from the host. Then, the VM allocation algorithm finds a host as a new placement for each VM to be migrated. In the second phase, Under-utilized host prediction algorithm finds a host that has minimum utilization currently and future than other hosts. The selected host does not become over-utilized by VMs placement. Once all VM migrations have been completed, the under-utilized host switches to the sleep mode in order to save energy cost. The selected VM from an over-utilized or under-utilized is allocated to a host that is found by VM allocation algorithm. Power-Aware Best Fit Decreasing (PABFD) [10] is a VM allocation method that provides the minimum power consumption by allocating the VM to a host. We modified the PABFD to reduce SLA violations besides the power cost by two following conditions, respectively: 1. Find hosts are not over-utilized at current and next times by allocating selected VMs (NotOverloadedHostList). 2. Choose a host from NotOverloadedHostList so that the power increasing is minimize after VM allocation (selectedHost). Algorithm 3- VMs allocation algorithm

2) Energy Consumption This metric is the total energy consumption by the physical resources of a data center caused by the application workloads. Table 2 illustrates the power consumption characteristics of the selected servers in the simulator. The first algorithm monitors the CPU utilization and migrates a VM when the current utilization exceeds a static threshold (THR). The threshold set to 80% for detecting an over-utilized host. Other three algorithms used adaptive thresholds to decide the VM migration. The next two algorithms adapt the utilization threshold dynamically based on the Median Absolute Deviation (MAD) and the Interquartile Range (IQR). The fourth method utilizes Loess method is a Local Regression (LR) approach to estimate the CPU utilization. Moreover, the same VM selection policy on these algorithms is considered in this paper. This policy is named Minimum Migration Time (MMT) because it selects a VM for migration that requires the minimum migration time than other VMs on the host. In order to compare the efficiency of the algorithms, the results are obtained for random and real workloads.

Input: selectedVM Output: selectedHost 1. for each host in hostList do 2. if (host has enough resource for selectedVM ) 3. if (Over-       4.        5.   ! 6. for each host in NotOverloadedHostList do 7.

    "  8. if (power