# Energy-Efficient Multi-Job Scheduling Model for Cloud Computing and Its Genetic Algorithm

Authors: Xiaoli Wang; Yuping Wang; Hai Zhu
Journal: Mathematical Problems in Engineering
 (2012)

---

## Abstract

For the problem that the energy efficiency of the cloud computing data center is low, from the point of view of the energy efficiency of the servers, we propose a new energy-efficient multi-job scheduling model based on Google’s massive data processing framework. To solve this model, we design a practical encoding and decoding method for the individuals and construct an overall energy efficiency function of the servers as the fitness value of each individual. Meanwhile, in order to accelerate the convergent speed of our algorithm and enhance its searching ability, a local search operator is introduced. Finally, the experiments show that the proposed algorithm is effective and efficient.


---

## Body

## 1. Introduction

Cloud computing [1] is a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction. As a new business model, while being favored by providing services such as on-demand self-service, broad network access, and rapid elasticity, cloud computing faces some new challenges. One of the prominent issues is the energy efficiency of data centers.According to Amazon’s CEMS project [2], based on a 3-year amortization schedule for servers and 15-year amortization schedule for other infrastructure, the monthly capital investment of the data center is illustrated in Figure 1. As can be seen from this figure, energy-related costs (including three parts: direct power consumption, power infrastructure, and cooling infrastructure) amount to 41.62% of the total. In other words, the largest investment to build data centers for cloud computing is not only to purchase thousands of server equipment, but also to buy the distribution and cooling infrastructure and to pay the bill for energy consumption of all these facilities. In order to illustrate the importance of energy consumption for data centers, we introduce the concept, power usage effectiveness (PUE), which was developed by a consortium called The Green Grid.Figure 1
Monthly costs of the data center.Definition 1.1.
Power usage effectiveness [3] is the ratio of total amount of power used by a data center facility to the power delivered to computing equipment. It is a measure of how efficiently a computer data center uses its power:
(1.1)PUE=TotalfacilitypowerITequipmentpower.The IT equipment power is the power delivered to the critical load, the servers in the data center, while the total facility power in addition to the servers also includes other energy facilities, specifically, the energy consumed by distribution and cooling infrastructure which accounts for the main part. A PUE of 2.0 states that, for every watt delivered to the servers, we dissipate 1 watt in cooling system and power distribution. That is, the data center has to pay 2 watts of electricity, but only one single watt for cloud computing, because only servers can provide cloud computing services. The energy utilization is only 50%. In the Environmental Protection Agency (EPA)’s report [4] to the US Congress, they estimate that, in 2006, the typical enterprise data center had a PUE of 2.0 or higher. It is expected that equipment efficiency improvements alone, with current practices, could result in a 2011 PUE of 1.9. Data centers combining these efficiency gains with better operational practices are expected to reach a PUE of 1.3~1.7. Beyond that, the EPA predicted that “state-of-the-art” data centers could reach a PUE of 1.2. By now, Google has claimed that their data centers, on average for all, have exceeded the EPA’s most optimistic scenario [5], which is of course accompanied by doubt voices from other cloud computing providers [2].To reduce the energy consumption of data centers and improve energy efficiency, many scholars have done some related research, such as literatures [6–10]. Overall, we can make efforts in three aspects.(1) Reduce power loss during distribution. However, the statistics from Amazon’s CEMS project show that, for a data center with a PUE of 1.7, an overall power distribution loss only accounts for 8% of total energy consumption. Even with better technology, the reduction will not exceed 8% [2].(2) Reduce energy consumed by cooling system. For example, you can use Google’s “free cooling” mode, removing heat from servers by using evaporating water or low temperature ambient air. Google claims that there is no cooling equipment in its data centers in Belgium [11]. The climate in Belgium will support free cooling almost year-round, according to Google engineers, with temperatures rising above the acceptable range for free cooling about seven days per year on average. The average temperature in Brussels during summer reaches 66 to 71 degrees, while Google maintains its data centers at temperatures above 80 degrees. If the weather gets hot, Google says it will turn off equipment as needed in Belgium and shift computing load to other data centers. This approach is made possible by the scope of the company’s global network of data centers, which provide the ability to shift an entire data center’s workload to other facilities.Although the “free cooling” mode can reduce the energy consumed by cooling system, it has a key prerequisite that the providers have sufficient enough financial and technical strength to run several data centers around the world and the data can backup across those data centers with seamless migration of computing load. This is hardly possible for majority of cloud computing providers.(3) Improve energy efficiency of servers. Say a data center with a PUE of 2.0, only 50% of the power can be used on severs. Therefore, it becomes critical whether servers have used all the energy to complete the workload. We are aware that low energy utilization of a server is mainly due to its idle state caused by low CPU utilization. Even at a very low load, such as 10% CPU utilization, the power consumed is over 50% of the peak power [12]. Thus, the energy efficiency of servers plays an important role for the entire energy efficiency of the data center.This paper mainly focuses on how to improve the energy efficiency of servers through appropriate scheduling strategies. Taking full consideration of the relationship between the performance and energy consumption of servers, we propose a new energy-efficient multi-job scheduling model based on the Google’s massive data processing framework, MapReduce, and give its corresponding algorithm. As the basics of our model, Section2 highlights Google’s MapReduce framework; Section 3 gives the mathematical description of the energy-efficient multi-job scheduling problem and its corresponding model. In order to solve this model, a genetic algorithm and its genetic operators are designed in Section 4. Finally, simulation experiments show the proposed algorithm is effective and efficient in Section 5.


## 2. MapReduce Framework

MapReduce [13] is Google’s massive data processing framework. It finishes the computation by mapping and reducing data under cluster environment. Users specify a mapfunction that processes a key/value pair to generate a set of intermediate key/value pairs and a reducefunction that merges all intermediate values associated with the same intermediate key. Many real world jobs are expressible in this model, for example, counting the frequency of all words appeared in a paper. Figure 2 shows the overall flow of a MapReduce operation. When the user program calls the MapReduce function, the following sequence of actions occurs (the numbered labels in Figure 2 correspond to the numbers in the list below).Figure 2
Overall flow of a MapReduce operation.Step 1.
The MapReduce library in the user program first splits the input files into M pieces of typically 64 megabytes (MBs) per piece. It then starts up many copies of the program on a cluster of machines.Step 2.
One of the copies of the program is special—the master. The rest are workers that are assigned work by the master. There areM map tasks and R reduce tasks to assign. The master picks idle workers and assigns each one a map task or a reduce task.Step 3.
A worker who is assigned a map task reads the contents of the corresponding input split. It parses key/value pairs out of the input data and passes each pair to the user-definedmapfunction. The intermediate key/value pairs produced by the mapfunction are buffered in memory.Step 4.
Periodically, the buffered pairs are written to local disk, partitioned intoR regions by the partitioning function. The locations of these buffered pairs on the local disk are passed back to the master, who is responsible for forwarding these locations to the reduce workers.Step 5.
When a reduce worker is notified by the master about these locations, it uses remote procedure calls to read the buffered data from the local disks of the map workers.Step 6.
The reduce worker iterates over the sorted intermediate data and for each unique intermediate key encountered; it passes the key and the corresponding set of intermediate values to the user’s reduce function. The output of the reduce function is appended to a final output file for this reduce partition.Step 7.
When all map tasks and reduce tasks have been completed, the master wakes up the user program. At this point, the MapReduce call in the user program returns back to the user code.


## 3. Energy-Efficient Multi-Job Scheduling Model Based on MapReduce

From the above background knowledge, we know that by improving the energy efficiency of servers, the PUE of data centers can be enhanced. However, this problem cannot be solved as easy as balancing loads among servers so as to make all the servers’ CPU utilization reach 100%. Instead, there exists an optimal performance and energy point for each server [12]. Energy consumption per task is influenced by the CPU utilization of servers (certainly, it may also be affected by other resource utilization such as memory, bandwidth, etc., but, in order to simplify the model, we only consider the impact of CPU utilization). When the CPU utilization is low, idle power is not amortized effectively and hence the energy per task is high. At high CPU utilization, on the other hand, energy consumption is high due to the competition for resources among tasks, which leads to performance degradation and longer execution time. Typical variation of energy per task with CPU utilization can be expected to result in a “U-shaped” curve. Therefore, it can be assumed that the servers achieve the maximum energy efficiency when all servers running at its optimal performance and power point. We can get this optimal point of each server by experiments. In literature [12], for example, data shows that the server meets the highest when its CPU utilization reaches 70%.We first give a general mathematical description of the energy-efficient multi-job scheduling problem and then build its corresponding single-objective optimization model.Assuming that there areN servers in a data center. The current CPU utilization of sever k is CSk and its optimal point is COk, where k=1,2,…N. There are F jobs A={A1,A2,…,AF} need to be processed, and the input data of job Aq is Dq, where q=1,2,…,F. The input data Dq will be divided into mq splits with each size of 64 M, so there are m̅=∑q=1Fmq splits, which are denoted as D={D1,D2,…,DF}={d1,d2,…,dm̅}. First, we need to randomly store these m̅ splits on N servers. To ensure the reliability of data, each split will choose three different servers for storage. We use a m̅×3 matrix P to represent the storage location of every split, and the element pij indicates the storage location of split di, where integer pij∈[1,N], i=1,2,…,m̅ and j=1,2,3. From the MapReduce framework, we know that each input data Dq will be processed by mq map tasks and rq reduce tasks, provided that the CPU required for every map task of job Aq is CMq and, for every reduce task, is CRq. The problem is how to assign these v=∑q=1Fmq+∑q=1Frq tasks on N servers, so that the energy efficiency of all servers reaches the highest.We use vectorS=(s1,s2,…si,…,sv) to represent the final task scheduling scheme, and the ith element of vector S indicates that task i is assigned on server si, where 1≤si≤N and i=1,2,…,v. Traversing through the scheduling scheme S, we can get the set of all map tasks and reduce tasks of job Aq which are assigned on server k, denoted as Mkq and Rkq, respectively, where k=1,2,…N and q=1,2,…,F. Let NMkq=|Mkq| and NRkq=|Rkq|. Here we give the single-objective optimization model for the energy-efficient multi-job scheduling problem based on MapReduce for cloud computing:(3.1)min⁡∑k=1N(COk-(CSk+∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq)))2(3.2)s.t.forschedulingschemeS,{si∈{pi1,pi2,pi3},fori=1,2,…,m̅,si∈[1,N],fori=m̅+1,m̅+2,…,v,(3.3)NMkq=|{si∣si=k,i=∑j=0q-1mj+1,∑j=0q-1mj+2,…,∑j=0q-1mj+mq}|,wherem0=0,k=1,2,…N,q=1,2,…,F,(3.4)NRkq=|{si∣si=k,i=m̅+∑j=0q-1rj+1,m̅+∑j=0q-1rj+2,…,m̅+∑j=0q-1rj+rq}|,wherer0=0,k=1,2,…N,q=1,2,…,F,(3.5)CSk+∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq)≤1,wherek=1,2,…N,CMq∈[0,1],CRq∈[0,1],q=1,2,…,F.The objective function indicates the minimum sum of the difference between all servers’ CPU utilizations after scheduling and their optimal points. Constraint (3.2) expresses that if a map task i is assigned to server si, then server si must have stored the corresponding input data of this map task. This is because the MapReduce framework is mainly used in massive data processing and the network bandwidth is a relatively scarce resource in cloud computing environment. MapReduce prefers moving the executive program to the node which stores the data, rather than moving the data as in traditional distributed computing. This scheduling scheme based on data location can avoid a large-scale data movement, which not only reduces the network overhead, but also makes the map tasks locally read and process the data. Constraints (3.3) and (3.4) compute the number of map tasks NMkq and reduce tasks NRkq of job Aq which are assigned to server k. Constraints (3.5) indicates that the CPU utilization of any server should not exceed 100% before and after the task scheduling.


## 4. An Energy-Efficient Multi-Job Scheduling Algorithm Based on MapReduce

Task scheduling is an NP problem, and the genetic algorithm based on evolutionary theory is very suitable for complex optimization problems. Here, we give the energy-efficient multi-job scheduling algorithm in detail, including the encoding, decoding methods for individuals, and other genetic operators. In particular, to make the new generated individuals meet the constraints, a modified operator is designed in the proposed algorithm. Meanwhile, in order to accelerate the convergence of the proposed algorithm, a local search operator is introduced. Finally, the overall genetic algorithm flow will be given in this section.


### 4.1. Encoding, Decoding, and Initializing Population

In genetic algorithm, the encoding method is of great significance. Based on the characteristics of this energy-efficient multi-job scheduling problem, we adopt the integer coding, provided that there arev=∑q=1Fmq+∑q=1Frq tasks need to be processed, including m̅=∑q=1Fmq map tasks and r̅=∑q=1Frq reduce tasks. We use vector S=(s1,s2,…,sv) as an individual to represent a scheduling scheme, where the ith element indicates task i is assigned on server si. This encoding method has the advantage that we can use relatively simple multipoint crossover operator for the evolution of individuals.When initializing individualS=(s1,s2,…,sv), for map tasks i=1,2,…m̅, it is necessary that they have to be assigned on servers which store their corresponding input data. Take a random integer j∈[1,3], let si=pij; for reduce tasks i=m̅+1,m̅+2,…,v, there is no such requirement, so just take a random integer k∈[1,N], let si=k.To compute individuals’ fitness value, we need to decode it first. The individual decoding method is as follows.Algorithm 4.1.
Step 1.
InitializingNMkq and NRkq, let NMkq=0 and NRkq=0, where k=1,2,…N and q=1,2,…q. Empty set Mk and Rk.Step 2.
For each elementsi of individual S, set k=si and m0=0. For job Aq, where q=1,2,…,F, if i=∑j=0q-1mj+1,∑j=0q-1mj+2,…,∑j=0q-1mj+mq,NMkq plus 1 and put i into set Mk; else if i=m̅+∑j=0q-1rj+1,m̅+∑j=0q-1rj+2,…,m̅+∑j=0q-1rj+rq, NRkq plus 1 and put i into set Rk.


### 4.2. Modified Operator

As the CPU utilization of each server cannot exceed 100% after task scheduling and whether an individual is generated by population initialization or by genetic operators like crossover and mutation, constraints cannot be guaranteed. So the new generated individuals may need to be modified. Based on different status for each server, we will remove its corresponding excess map tasks and reduce tasks allocated on it. The following shows the specific steps for the modified operator.Algorithm 4.2.
Step 1.
Say individualS need to be modified. Decode individual S according to Algorithm 4.1.Step 2.
Letk=1.Step 3.
Ifk>N, stop; else if CSk+∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq)>1, go to Step 4; otherwise, let k=k+1 go to Step 3.Step 4.
Letd=COk-CSk. If d≤0, go to Step 5; otherwise, go to Step 6.Step 5.
Equationd=0 indicates that server k has been the best state before task scheduling, so there is no need to assign more tasks on it, while d<0 means that the CPU utilization of server k has already been higher than its optimal point before task scheduling, so the best choice is not to assign more tasks on it. Therefore, in both cases, all tasks allocated on server k should be deleted. Let cut=∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq), go to Step 7.Step 6.
Ifd>0, then server k has not been the best state before scheduling, but its CPU utilization exceeds 100% after the scheduling, so we need to remove the excess part of its assignment. Let cut=CSk+∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq)-COk. In order to avoid the situation that is always deleting tasks with smaller numbers, which is caused by the fixed sequence of sets Mk and Nk, we randomly disrupt task orders in them.Step 7.
Remove excess map tasks. Forx=1,2,…,NMk, take the xth map task i from set Mk. There exists an integer s∈[1,F] which satisfies ∑q=1smq≤i≤∑q=1s+1mq. The value of s indicates that this map task belongs to job As thus, its CPU requirement is CMs. If cut-CMs<0, then go to Step 8; otherwise, reassign task i to a new server w which satisfies w≠k and w∈{pi1,pi2,pi3}. Set si=w. Continue the next iteration, let x=x+1 and cut=cut-CMs.Step 8.
Remove excess reduce tasks. Forx=1,2,…NRk, take the xth reduce task i from set Rk. There exists an integer s∈[1,F] which satisfies m̅+∑q=1srq≤i≤m̅+∑q=1s+1rq. The value of s indicates that this reduce task belongs to job As, and its CPU requirement is CRs. If cut-CRs<0, then go to Step 1; otherwise, reassign this task to a new server w which satisfies w∈[1,N] and w≠k. Set si=w. Start the next iteration, let x=x+1 and cut=cut-CRs.


### 4.3. Crossover Operator

We adopt the multipoint crossover operator for the evolution of individuals. To make individuals meet the constraints of our model, the new generated individuals may need to be modified. Meanwhile, in order to speed up the convergence of the proposed algorithm, we conduct a local search for the new generated individuals. Take two jobsF=2 as an example, and the crossover process is as follows.Algorithm 4.3.
Step 1.
Say the crossover probability ispc. Empty the crossover pool set pl. For each individual in the population, generate a real number q∈[0,1]. If q≤pc, then put this individual into pl.Step 2.
Ifpl is empty or there is only one individual in it, stop; otherwise, select two individuals S1 and S2 from pl without replacement. Generate four random integers c1∈[1,m1], c2∈[m1+1,m̅], c3∈[m̅+1,m̅+r1], and c4∈[m̅+r1+1,v] as the crossover points.Step 3.
For individualsS1 and S2, generate new individuals S3 and S4 as follows:
(4.1)S1=(s11,…,sc11,⋮sc1+11,…,sc21,⋮sc2+11,…,sc31,⋮sc3+11,…,sc41,⋮sc4+11,…,sv1)S2=(s12,…,sc12,⋮sc1+12,…,sc22,⋮sc2+12,…,sc32,⋮sc3+12,…,sc42,⋮sc4+12,…,sv2)⇓⇓⇓⇓⇓S3=(s11,…,sc11,⋮sc1+12,…,sc22,⋮sc2+11,…,sc31,⋮sc3+12,⋯,sc42,⋮sc4+11,…,sv1)S4=(s12,…,sc12,⋮sc1+11,…,sc21,⋮sc2+12,…,sc32,⋮sc3+11,…,sc41,⋮sc4+12,…,sv2).Step 4.
Modify individualsS3 and S4 according to Algorithm 4.2.Step 5.
Locally search individualsS3 and S4 according to Algorithm 4.5. Go to Step 2.


### 4.4. Mutation Operator

We use single-point mutation operator for the evolution of individuals. To make individuals meet the constraints of our model, the new generated individuals may need to be modified. Meanwhile, in order to speed up the convergence of our algorithm, we conduct a local search for the new generated individuals. The mutation process is as follows.Algorithm 4.4.
Step 1.
Select individuals from the offspring of crossover according to the mutation probabilitypm.Step 2.
For each selected offspring, sayS=(s1,s2,…si,…,sv), randomly generate an integer i∈[1,v]. If i≤m̅, then task i is a map task, reassign this task to a new server w which satisfies w≠si and w∈{pi1,pi2,pi3}. Set si=w; otherwise, task i is a reduce task. Randomly generate an integer k∈[1,N] that satisfies k≠si. Set si=k. The new generated individual is denoted as S′.Step 3.
Modify individualS′ according to Algorithm 4.2.Step 4.
Locally search individualS′ according to Algorithm 4.5.


### 4.5. Local Search Operator

In order to accelerate the convergent speed and enhance the searching ability of the proposed algorithm, a local search operator is designed in this paper. We know that after scheduling the smaller the difference between the CPU utilization and the optimal point, the better the individual. Thus, in each iteration, we select the server with the maximum difference between the CPU utilization after scheduling and its optimal point, then reassign tasks on it. If the new generated individual is better than the current one, update the current individual and continue to the next iteration; otherwise, stop the local search.Algorithm 4.5.
Step 1.
Say the fitness value of individualS is f. Copy this individual. Let S′=S.Step 2.
Decode individualS′ according to Algorithm 4.1.Step 3.
Among all the servers, there exists a serverk with the highest CPU utilization, and at least one task is assigned on it. Let d=COk-CSk. If d<0, then the initial CPU utilization of server k has been higher than its optimal point before scheduling, so all tasks allocated on server k should be deleted. Let cut=∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq), go to Step 4; otherwise, let cut=CSk+∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq)-COk. Randomly disrupt task orders in sets Mk and Nk.Step 4.
Remove excess map tasks. Forx=1,2,…,NMk, take the xth map task i from set Mk. There exists an integer s∈[1,F] which satisfies ∑q=1smq≤i≤∑q=1s+1mq. If cut-CMs<0, then go to Step 5; otherwise, reassign task i on a new server w which satisfies w≠k and w∈{pi1,pi2,pi3}. Let si=w and cut=cut-CMs.Step 5.
Remove excess reduce tasks. Forx=1,2,…,NRk, take the xth reduce task i from set Rk. There exists an integer s∈[1,F] which satisfies m̅+∑q=1srq≤i≤m̅+∑q=1s+1rq. If cut-CRs<0, compute the fitness value of individual S′ denoted as f′; otherwise, reassign a server w which satisfies w∈[1,N] and w≠k for task i. Let si=w and cut=cut-CRs.Step 6.
Iff′<f, then S′ is better than S, let S=S′, and go to Step 2; otherwise, recopy individual S, let S′=S. Decode individual S′ according to Algorithm 4.1.Step 7.
Among all the servers, there exists a serverk with the lowest CPU utilization.
Letadd=COk-CSk+∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq).Step 8.
Add map tasks. According to the storage location of each data split, we can get all tasks which can be assigned on serverk, denoted as set MMk. Randomly disrupt task orders in set MMk.Step 9.
There exists a map taskp∈MMk and sp′≠k. For this task, there exists an integer s∈[1,F] which satisfies ∑q=1smq≤p≤∑q=1s+1mq. If add-CMp<0, go to Step 10; otherwise, let sp′=k and add=add-CMp, go to Step 9.Step 10.
Add reduce tasks: There exists taskp∈[m̅+1,v] and sp′≠k. For this task, there exists an integer s∈[1,F] which satisfies m̅+∑q=1srq≤p≤m̅+∑q=1s+1rq. If add-CRp<0, compute the fitness value of individual S′ denoted as f′; otherwise, let sp′=k and add=add-CRp, go to Step 10.Step 11.
Iff′<f, then S′ is better than S. Let S=S′, go to Step 7; otherwise, stop.


### 4.6. An Energy-Efficient Multi-Job Scheduling Algorithm Based on MapReduce

Algorithm 4.6.
Step 1.
Initializing. Choose proper genetic parameters: population sizeX, crossover probability pc, mutation probability pm, and elitist number k. Generate an initial population P. Modify each individual in population P according to Algorithm 4.2, and compute its fitness values. Set generation number t=0.Step 2.
Crossover. Execute crossover by Algorithm4.3. The offspring set is denoted as P1 and compute each individual’s fitness value.Step 3.
Mutation. Execute mutation onP1 by Algorithm 4.4. The offspring set is denoted as P2, and compute each individual’s fitness value.Step 4.
Elitist strategy. Sort the individuals in setP∪P1∪P2 according to its fitness value, and select the best k individuals directly to form the next generation population, while the others are selected by using roulette wheel method on the set P∪P1∪P2.Step 5.
If stopping criterion is not met, lett=t+1, go to Step 2; otherwise, stop.


## 4.1. Encoding, Decoding, and Initializing Population

In genetic algorithm, the encoding method is of great significance. Based on the characteristics of this energy-efficient multi-job scheduling problem, we adopt the integer coding, provided that there arev=∑q=1Fmq+∑q=1Frq tasks need to be processed, including m̅=∑q=1Fmq map tasks and r̅=∑q=1Frq reduce tasks. We use vector S=(s1,s2,…,sv) as an individual to represent a scheduling scheme, where the ith element indicates task i is assigned on server si. This encoding method has the advantage that we can use relatively simple multipoint crossover operator for the evolution of individuals.When initializing individualS=(s1,s2,…,sv), for map tasks i=1,2,…m̅, it is necessary that they have to be assigned on servers which store their corresponding input data. Take a random integer j∈[1,3], let si=pij; for reduce tasks i=m̅+1,m̅+2,…,v, there is no such requirement, so just take a random integer k∈[1,N], let si=k.To compute individuals’ fitness value, we need to decode it first. The individual decoding method is as follows.Algorithm 4.1.
Step 1.
InitializingNMkq and NRkq, let NMkq=0 and NRkq=0, where k=1,2,…N and q=1,2,…q. Empty set Mk and Rk.Step 2.
For each elementsi of individual S, set k=si and m0=0. For job Aq, where q=1,2,…,F, if i=∑j=0q-1mj+1,∑j=0q-1mj+2,…,∑j=0q-1mj+mq,NMkq plus 1 and put i into set Mk; else if i=m̅+∑j=0q-1rj+1,m̅+∑j=0q-1rj+2,…,m̅+∑j=0q-1rj+rq, NRkq plus 1 and put i into set Rk.


## 4.2. Modified Operator

As the CPU utilization of each server cannot exceed 100% after task scheduling and whether an individual is generated by population initialization or by genetic operators like crossover and mutation, constraints cannot be guaranteed. So the new generated individuals may need to be modified. Based on different status for each server, we will remove its corresponding excess map tasks and reduce tasks allocated on it. The following shows the specific steps for the modified operator.Algorithm 4.2.
Step 1.
Say individualS need to be modified. Decode individual S according to Algorithm 4.1.Step 2.
Letk=1.Step 3.
Ifk>N, stop; else if CSk+∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq)>1, go to Step 4; otherwise, let k=k+1 go to Step 3.Step 4.
Letd=COk-CSk. If d≤0, go to Step 5; otherwise, go to Step 6.Step 5.
Equationd=0 indicates that server k has been the best state before task scheduling, so there is no need to assign more tasks on it, while d<0 means that the CPU utilization of server k has already been higher than its optimal point before task scheduling, so the best choice is not to assign more tasks on it. Therefore, in both cases, all tasks allocated on server k should be deleted. Let cut=∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq), go to Step 7.Step 6.
Ifd>0, then server k has not been the best state before scheduling, but its CPU utilization exceeds 100% after the scheduling, so we need to remove the excess part of its assignment. Let cut=CSk+∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq)-COk. In order to avoid the situation that is always deleting tasks with smaller numbers, which is caused by the fixed sequence of sets Mk and Nk, we randomly disrupt task orders in them.Step 7.
Remove excess map tasks. Forx=1,2,…,NMk, take the xth map task i from set Mk. There exists an integer s∈[1,F] which satisfies ∑q=1smq≤i≤∑q=1s+1mq. The value of s indicates that this map task belongs to job As thus, its CPU requirement is CMs. If cut-CMs<0, then go to Step 8; otherwise, reassign task i to a new server w which satisfies w≠k and w∈{pi1,pi2,pi3}. Set si=w. Continue the next iteration, let x=x+1 and cut=cut-CMs.Step 8.
Remove excess reduce tasks. Forx=1,2,…NRk, take the xth reduce task i from set Rk. There exists an integer s∈[1,F] which satisfies m̅+∑q=1srq≤i≤m̅+∑q=1s+1rq. The value of s indicates that this reduce task belongs to job As, and its CPU requirement is CRs. If cut-CRs<0, then go to Step 1; otherwise, reassign this task to a new server w which satisfies w∈[1,N] and w≠k. Set si=w. Start the next iteration, let x=x+1 and cut=cut-CRs.


## 4.3. Crossover Operator

We adopt the multipoint crossover operator for the evolution of individuals. To make individuals meet the constraints of our model, the new generated individuals may need to be modified. Meanwhile, in order to speed up the convergence of the proposed algorithm, we conduct a local search for the new generated individuals. Take two jobsF=2 as an example, and the crossover process is as follows.Algorithm 4.3.
Step 1.
Say the crossover probability ispc. Empty the crossover pool set pl. For each individual in the population, generate a real number q∈[0,1]. If q≤pc, then put this individual into pl.Step 2.
Ifpl is empty or there is only one individual in it, stop; otherwise, select two individuals S1 and S2 from pl without replacement. Generate four random integers c1∈[1,m1], c2∈[m1+1,m̅], c3∈[m̅+1,m̅+r1], and c4∈[m̅+r1+1,v] as the crossover points.Step 3.
For individualsS1 and S2, generate new individuals S3 and S4 as follows:
(4.1)S1=(s11,…,sc11,⋮sc1+11,…,sc21,⋮sc2+11,…,sc31,⋮sc3+11,…,sc41,⋮sc4+11,…,sv1)S2=(s12,…,sc12,⋮sc1+12,…,sc22,⋮sc2+12,…,sc32,⋮sc3+12,…,sc42,⋮sc4+12,…,sv2)⇓⇓⇓⇓⇓S3=(s11,…,sc11,⋮sc1+12,…,sc22,⋮sc2+11,…,sc31,⋮sc3+12,⋯,sc42,⋮sc4+11,…,sv1)S4=(s12,…,sc12,⋮sc1+11,…,sc21,⋮sc2+12,…,sc32,⋮sc3+11,…,sc41,⋮sc4+12,…,sv2).Step 4.
Modify individualsS3 and S4 according to Algorithm 4.2.Step 5.
Locally search individualsS3 and S4 according to Algorithm 4.5. Go to Step 2.


## 4.4. Mutation Operator

We use single-point mutation operator for the evolution of individuals. To make individuals meet the constraints of our model, the new generated individuals may need to be modified. Meanwhile, in order to speed up the convergence of our algorithm, we conduct a local search for the new generated individuals. The mutation process is as follows.Algorithm 4.4.
Step 1.
Select individuals from the offspring of crossover according to the mutation probabilitypm.Step 2.
For each selected offspring, sayS=(s1,s2,…si,…,sv), randomly generate an integer i∈[1,v]. If i≤m̅, then task i is a map task, reassign this task to a new server w which satisfies w≠si and w∈{pi1,pi2,pi3}. Set si=w; otherwise, task i is a reduce task. Randomly generate an integer k∈[1,N] that satisfies k≠si. Set si=k. The new generated individual is denoted as S′.Step 3.
Modify individualS′ according to Algorithm 4.2.Step 4.
Locally search individualS′ according to Algorithm 4.5.


## 4.5. Local Search Operator

In order to accelerate the convergent speed and enhance the searching ability of the proposed algorithm, a local search operator is designed in this paper. We know that after scheduling the smaller the difference between the CPU utilization and the optimal point, the better the individual. Thus, in each iteration, we select the server with the maximum difference between the CPU utilization after scheduling and its optimal point, then reassign tasks on it. If the new generated individual is better than the current one, update the current individual and continue to the next iteration; otherwise, stop the local search.Algorithm 4.5.
Step 1.
Say the fitness value of individualS is f. Copy this individual. Let S′=S.Step 2.
Decode individualS′ according to Algorithm 4.1.Step 3.
Among all the servers, there exists a serverk with the highest CPU utilization, and at least one task is assigned on it. Let d=COk-CSk. If d<0, then the initial CPU utilization of server k has been higher than its optimal point before scheduling, so all tasks allocated on server k should be deleted. Let cut=∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq), go to Step 4; otherwise, let cut=CSk+∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq)-COk. Randomly disrupt task orders in sets Mk and Nk.Step 4.
Remove excess map tasks. Forx=1,2,…,NMk, take the xth map task i from set Mk. There exists an integer s∈[1,F] which satisfies ∑q=1smq≤i≤∑q=1s+1mq. If cut-CMs<0, then go to Step 5; otherwise, reassign task i on a new server w which satisfies w≠k and w∈{pi1,pi2,pi3}. Let si=w and cut=cut-CMs.Step 5.
Remove excess reduce tasks. Forx=1,2,…,NRk, take the xth reduce task i from set Rk. There exists an integer s∈[1,F] which satisfies m̅+∑q=1srq≤i≤m̅+∑q=1s+1rq. If cut-CRs<0, compute the fitness value of individual S′ denoted as f′; otherwise, reassign a server w which satisfies w∈[1,N] and w≠k for task i. Let si=w and cut=cut-CRs.Step 6.
Iff′<f, then S′ is better than S, let S=S′, and go to Step 2; otherwise, recopy individual S, let S′=S. Decode individual S′ according to Algorithm 4.1.Step 7.
Among all the servers, there exists a serverk with the lowest CPU utilization.
Letadd=COk-CSk+∑q=1F(NMkq×CMq)+∑q=1F(NRkq×CRq).Step 8.
Add map tasks. According to the storage location of each data split, we can get all tasks which can be assigned on serverk, denoted as set MMk. Randomly disrupt task orders in set MMk.Step 9.
There exists a map taskp∈MMk and sp′≠k. For this task, there exists an integer s∈[1,F] which satisfies ∑q=1smq≤p≤∑q=1s+1mq. If add-CMp<0, go to Step 10; otherwise, let sp′=k and add=add-CMp, go to Step 9.Step 10.
Add reduce tasks: There exists taskp∈[m̅+1,v] and sp′≠k. For this task, there exists an integer s∈[1,F] which satisfies m̅+∑q=1srq≤p≤m̅+∑q=1s+1rq. If add-CRp<0, compute the fitness value of individual S′ denoted as f′; otherwise, let sp′=k and add=add-CRp, go to Step 10.Step 11.
Iff′<f, then S′ is better than S. Let S=S′, go to Step 7; otherwise, stop.


## 4.6. An Energy-Efficient Multi-Job Scheduling Algorithm Based on MapReduce

Algorithm 4.6.
Step 1.
Initializing. Choose proper genetic parameters: population sizeX, crossover probability pc, mutation probability pm, and elitist number k. Generate an initial population P. Modify each individual in population P according to Algorithm 4.2, and compute its fitness values. Set generation number t=0.Step 2.
Crossover. Execute crossover by Algorithm4.3. The offspring set is denoted as P1 and compute each individual’s fitness value.Step 3.
Mutation. Execute mutation onP1 by Algorithm 4.4. The offspring set is denoted as P2, and compute each individual’s fitness value.Step 4.
Elitist strategy. Sort the individuals in setP∪P1∪P2 according to its fitness value, and select the best k individuals directly to form the next generation population, while the others are selected by using roulette wheel method on the set P∪P1∪P2.Step 5.
If stopping criterion is not met, lett=t+1, go to Step 2; otherwise, stop.


## 5. Experiments and Analysis

### 5.1. Parameter Values

Given that there are 200 servers in a data center and 2 jobs need to be processed, asN=200 and F=2, the data sizes of the jobs are 500 G and 750 G, respectively, and they can be divided into 8000 splits and 12000 splits, which means m1=8000 and m2=12000. Each split randomly selects three servers to back up its data. Suppose that the number of reduce tasks required for completing the two jobs are 180 and 270, respectively, which means r1=180 and r2=270.Based on a 3-year amortization schedule for servers in a data center, different server may have different optimal performance-energy point for how long it has been used. Here we assume that 1/3 servers have been used for one year with their optimal point of 0.9. Other 1/3 servers have been used for two years with their optimal point of 0.7, while the others have been used for three years with their optimal point of 0.5. Take random real numbers over[0,0.35] as servers’ initial CPU utilization value. To reflect the effectiveness of the proposed algorithm well, we set some special initial states of servers as follows:(5.1)CS5=0.5,CS25=0.7,CS45=0.9,CS75=0.5,CS95=0.7,CS115=0.9,CS145=0.5,CS165=0.7,CS195=0.9.In the proposed energy-efficient multi-job scheduling algorithm, we adopt the following genetic parameters: population sizeX=100; crossover probability pc=0.6; mutation probability pm=0.02; elitist number k=5; stop criterion t=2000.


### 5.2. Simulation Results and Comparions

We conduct three sets of comparative experiments between the proposed algorithm and Hadoop MapReduce which is an open-source MapReduce framework implementation [14].Comparison 1
Set the CPU requirements for each map task of the two jobs asCM1=0.0055 and CM2=0.0046, respectively, and the CPU requirements for each reduce tasks as CR1=0.0017 and CR=0.0022, respectively. The experimental results of the energy-efficient multi-job scheduling algorithm proposed in this paper are shown in Figure 3(a), while the results of the Hadoop MapReduce scheduling are shown in Figure 3(b).(a) The results of the energy-efficient multi-job scheduling algorithm in experiment 1. (b) The results of the Hadoop MapReduce scheduling algorithm in experiment 1. (c) The total amount of tasks assigned on each server in experiment 1.
(a)(b)(c)It can be clearly seen by comparing Figure3(a) with Figure 3(b) that the proposed algorithm in this paper can effectively schedule multi-job on servers according to each server’s optimal performance-energy point. For the 5th, 75th, and 145th servers with the same initial CPU utilization of 0.5, since the optimal points of these three servers are 0.9, 0.7, and 0.5, the proposed algorithm only assigns tasks on the 5th and 75th servers, while the 145th server stays at its original state. Similarly, for the 25th, 95th, and 165th servers with the same initial CPU utilization of 0.7, the proposed algorithm only assigns tasks on the 25th server. Also, for the 45th, 115th, and 195th servers with the same initial CPU utilization of 0.9, the proposed algorithm does not assign any tasks on them. From another perspective, we check the total amount of tasks assigned on each server. For the proposed algorithm, it can be seen from Figure 3(c) that the higher the server’s optimal performance-energy point, the more tasks it needs to deal with, expect for those servers with high initial CUP utilization, while, for the Hadoop MapReduce scheduling, if not taken server’s initial state into consideration, tasks are assigned nearly equally. Furthermore, computing the energy efficiency of all servers by the proposed algorithm and Hadoop MapReduce scheduling according to the objective function in our model, we will get the results of 0.240227 and 6.79271, respectively, which means that the proposed algorithm can greatly improve the energy efficiency of servers, so as to enhance the PUE of data centers.Comparison 2
Suppose that the input data to be processed is relatively small. Set the CPU requirements for each map task of the two jobs asCM1=0.0042 and CM2=0.004, respectively, and the CPU requirements for each reduce tasks as CR1=0.0015 and CR=0.002, respectively. The experimental results of the energy-efficient multi-job scheduling algorithm proposed in this paper are shown in Figure 4(a), while the results of the Hadoop MapReduce scheduling are shown in Figure 4(b).(a) The results of the energy-efficient multi-job scheduling algorithm in experiment 2. (b) The results of the Hadoop MapReduce scheduling algorithm in experiment 2. (c) The total amount of tasks assigned on each server in experiment 2.
(a)(b)(c)From Figure4(a), it can be seen that even when the input data to be processed is relatively small, the proposed algorithm can effectively schedule multi-job on servers according to each server’s optimal performance-energy point. Although the CPU utilizations of all servers are not able to reach their optimal points after the scheduling, each server’s CPU utilization is near as much as possible to its optimal point. Similar to comparison 1, we check the total amount of tasks assigned on each server. For the proposed algorithm, it can be seen from Figure 4(c) that the higher the server’s optimal performance-energy point, the more tasks it needs to deal with, expect for those servers with high initial CUP utilization, while, for the Hadoop MapReduce scheduling, if not taken server’s initial state into consideration, tasks are assigned nearly balancing. Furthermore, computing the energy efficiency of all servers by the proposed algorithm and Hadoop MapReduce scheduling according to the objective function in our model, we will get the results of 1.12455 and 8.61073, respectively, which proves that the proposed algorithm can greatly improve the energy efficiency of servers, so as to enhance the PUE of data centers.Comparison 3
Suppose that the input data to be processed is relatively large. Set the CPU requirements for each map task of the two jobs asCM1=0.0065 and CM2=0.0054, respectively, and the CPU requirements for each reduce tasks as CR1=0.002 and CR=0.003, respectively. The experimental results of the energy-efficient multi-job scheduling algorithm proposed in this paper are shown in Figure 5(a), while the results of the Hadoop MapReduce scheduling are shown in Figure 5(b).(a) The results of the energy-efficient multi-job scheduling algorithm in experiment 3. (b) The results of the Hadoop MapReduce scheduling algorithm in experiment 3. (c) The total amount of tasks assigned on each server in experiment 3.
(a)(b)(c)From Figure5(a), it can be seen that even when the input data to be processed is relatively large, the proposed algorithm in this paper can effectively schedule multi-job on servers according to each server’s optimal performance-energy point. Although the CPU utilizations of all servers are beyond their optimal points after the scheduling, each server’s CUP utilization is near as much as possible to its optimal point. From another perspective, we check the total amount of tasks assigned on each server. For the proposed algorithm, it can be seen from Figure 5(c) that the higher the server’s optimal performance-energy point, the more tasks it needs to deal with, expect for those servers with high initial CUP utilization, while, for the Hadoop MapReduce scheduling, if not taken server’s initial state into consideration, tasks are assigned nearly balancing. Furthermore, computing the energy efficiency of all servers by the proposed algorithm and Hadoop MapReduce scheduling according to the objective function in our model, we will get the results of 1.93834 and 7.37484, respectively, which proves that the proposed algorithm can greatly improve the energy efficiency of servers, so as to enhance the PUE of data centers.


## 5.1. Parameter Values

Given that there are 200 servers in a data center and 2 jobs need to be processed, asN=200 and F=2, the data sizes of the jobs are 500 G and 750 G, respectively, and they can be divided into 8000 splits and 12000 splits, which means m1=8000 and m2=12000. Each split randomly selects three servers to back up its data. Suppose that the number of reduce tasks required for completing the two jobs are 180 and 270, respectively, which means r1=180 and r2=270.Based on a 3-year amortization schedule for servers in a data center, different server may have different optimal performance-energy point for how long it has been used. Here we assume that 1/3 servers have been used for one year with their optimal point of 0.9. Other 1/3 servers have been used for two years with their optimal point of 0.7, while the others have been used for three years with their optimal point of 0.5. Take random real numbers over[0,0.35] as servers’ initial CPU utilization value. To reflect the effectiveness of the proposed algorithm well, we set some special initial states of servers as follows:(5.1)CS5=0.5,CS25=0.7,CS45=0.9,CS75=0.5,CS95=0.7,CS115=0.9,CS145=0.5,CS165=0.7,CS195=0.9.In the proposed energy-efficient multi-job scheduling algorithm, we adopt the following genetic parameters: population sizeX=100; crossover probability pc=0.6; mutation probability pm=0.02; elitist number k=5; stop criterion t=2000.


## 5.2. Simulation Results and Comparions

We conduct three sets of comparative experiments between the proposed algorithm and Hadoop MapReduce which is an open-source MapReduce framework implementation [14].Comparison 1
Set the CPU requirements for each map task of the two jobs asCM1=0.0055 and CM2=0.0046, respectively, and the CPU requirements for each reduce tasks as CR1=0.0017 and CR=0.0022, respectively. The experimental results of the energy-efficient multi-job scheduling algorithm proposed in this paper are shown in Figure 3(a), while the results of the Hadoop MapReduce scheduling are shown in Figure 3(b).(a) The results of the energy-efficient multi-job scheduling algorithm in experiment 1. (b) The results of the Hadoop MapReduce scheduling algorithm in experiment 1. (c) The total amount of tasks assigned on each server in experiment 1.
(a)(b)(c)It can be clearly seen by comparing Figure3(a) with Figure 3(b) that the proposed algorithm in this paper can effectively schedule multi-job on servers according to each server’s optimal performance-energy point. For the 5th, 75th, and 145th servers with the same initial CPU utilization of 0.5, since the optimal points of these three servers are 0.9, 0.7, and 0.5, the proposed algorithm only assigns tasks on the 5th and 75th servers, while the 145th server stays at its original state. Similarly, for the 25th, 95th, and 165th servers with the same initial CPU utilization of 0.7, the proposed algorithm only assigns tasks on the 25th server. Also, for the 45th, 115th, and 195th servers with the same initial CPU utilization of 0.9, the proposed algorithm does not assign any tasks on them. From another perspective, we check the total amount of tasks assigned on each server. For the proposed algorithm, it can be seen from Figure 3(c) that the higher the server’s optimal performance-energy point, the more tasks it needs to deal with, expect for those servers with high initial CUP utilization, while, for the Hadoop MapReduce scheduling, if not taken server’s initial state into consideration, tasks are assigned nearly equally. Furthermore, computing the energy efficiency of all servers by the proposed algorithm and Hadoop MapReduce scheduling according to the objective function in our model, we will get the results of 0.240227 and 6.79271, respectively, which means that the proposed algorithm can greatly improve the energy efficiency of servers, so as to enhance the PUE of data centers.Comparison 2
Suppose that the input data to be processed is relatively small. Set the CPU requirements for each map task of the two jobs asCM1=0.0042 and CM2=0.004, respectively, and the CPU requirements for each reduce tasks as CR1=0.0015 and CR=0.002, respectively. The experimental results of the energy-efficient multi-job scheduling algorithm proposed in this paper are shown in Figure 4(a), while the results of the Hadoop MapReduce scheduling are shown in Figure 4(b).(a) The results of the energy-efficient multi-job scheduling algorithm in experiment 2. (b) The results of the Hadoop MapReduce scheduling algorithm in experiment 2. (c) The total amount of tasks assigned on each server in experiment 2.
(a)(b)(c)From Figure4(a), it can be seen that even when the input data to be processed is relatively small, the proposed algorithm can effectively schedule multi-job on servers according to each server’s optimal performance-energy point. Although the CPU utilizations of all servers are not able to reach their optimal points after the scheduling, each server’s CPU utilization is near as much as possible to its optimal point. Similar to comparison 1, we check the total amount of tasks assigned on each server. For the proposed algorithm, it can be seen from Figure 4(c) that the higher the server’s optimal performance-energy point, the more tasks it needs to deal with, expect for those servers with high initial CUP utilization, while, for the Hadoop MapReduce scheduling, if not taken server’s initial state into consideration, tasks are assigned nearly balancing. Furthermore, computing the energy efficiency of all servers by the proposed algorithm and Hadoop MapReduce scheduling according to the objective function in our model, we will get the results of 1.12455 and 8.61073, respectively, which proves that the proposed algorithm can greatly improve the energy efficiency of servers, so as to enhance the PUE of data centers.Comparison 3
Suppose that the input data to be processed is relatively large. Set the CPU requirements for each map task of the two jobs asCM1=0.0065 and CM2=0.0054, respectively, and the CPU requirements for each reduce tasks as CR1=0.002 and CR=0.003, respectively. The experimental results of the energy-efficient multi-job scheduling algorithm proposed in this paper are shown in Figure 5(a), while the results of the Hadoop MapReduce scheduling are shown in Figure 5(b).(a) The results of the energy-efficient multi-job scheduling algorithm in experiment 3. (b) The results of the Hadoop MapReduce scheduling algorithm in experiment 3. (c) The total amount of tasks assigned on each server in experiment 3.
(a)(b)(c)From Figure5(a), it can be seen that even when the input data to be processed is relatively large, the proposed algorithm in this paper can effectively schedule multi-job on servers according to each server’s optimal performance-energy point. Although the CPU utilizations of all servers are beyond their optimal points after the scheduling, each server’s CUP utilization is near as much as possible to its optimal point. From another perspective, we check the total amount of tasks assigned on each server. For the proposed algorithm, it can be seen from Figure 5(c) that the higher the server’s optimal performance-energy point, the more tasks it needs to deal with, expect for those servers with high initial CUP utilization, while, for the Hadoop MapReduce scheduling, if not taken server’s initial state into consideration, tasks are assigned nearly balancing. Furthermore, computing the energy efficiency of all servers by the proposed algorithm and Hadoop MapReduce scheduling according to the objective function in our model, we will get the results of 1.93834 and 7.37484, respectively, which proves that the proposed algorithm can greatly improve the energy efficiency of servers, so as to enhance the PUE of data centers.


## 6. Conclusion

The energy efficiency of servers plays a significant role in the overall energy consumption of the data center. This paper mainly focuses on how to improve the energy efficiency of servers through appropriate scheduling strategies. Taking full consideration of the relationship between the performance and energy consumption of servers, we propose a new energy-efficient multi-job scheduling model based on the Google’s massive data processing framework, MapReduce, and give the corresponding algorithm. Meanwhile, we design a practical encoding and decoding method for the individuals and construct an overall energy efficiency function of the servers as the fitness value of the individual. Also, in order to accelerate the convergent speed and enhance the searching ability of our algorithm, a local search operator is introduced. Finally, the experiments show that the proposed algorithm is effective and efficient.



---

*Source: 589243-2012-02-08.xml*