Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation

Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation

ARTICLE IN PRESS JID: CAEE [m3Gsc;October 19, 2016;19:26] Computers and Electrical Engineering 0 0 0 (2016) 1–13 Contents lists available at Scien...

2MB Sizes 0 Downloads 101 Views

ARTICLE IN PRESS

JID: CAEE

[m3Gsc;October 19, 2016;19:26]

Computers and Electrical Engineering 0 0 0 (2016) 1–13

Contents lists available at ScienceDirect

Computers and Electrical Engineering journal homepage: www.elsevier.com/locate/compeleceng

Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocationR TP Shabeera∗, SD Madhu Kumar, Priya Chandran Department of Computer Science and Engineering, National Institute of Technology Calicut, Kerala, 673601, India

a r t i c l e

i n f o

Article history: Received 14 August 2015 Revised 12 October 2016 Accepted 12 October 2016 Available online xxx Keywords: MapReduce Cloud computing Big data Virtual machines Virtual machine allocation

a b s t r a c t Cloud-based MapReduce platforms offer ready to use MapReduce clusters. The problem of allocating Virtual Machines (VMs) carrying out the computation, for minimizing data transfer delay is a crucial one in this context, as the MapReduce tasks are communication intensive. The interaction between VMs may face varying delays, if the VMs are hosted in different Physical Machines (PMs). This work aims to optimize the data transfer delay between VMs, which is denoted by the distance between the VMs. We propose an approximation algorithm for VM allocation in data centers wherein the distances between VMs satisfy triangular inequality and an optimization algorithm for VM allocation in data centers where the distances between VMs do not satisfy triangular inequality. Simulations on CloudSim demonstrate the performance of our algorithms and the results affirm the reduction in job completion time compared to other allocation schemes. © 2016 Elsevier Ltd. All rights reserved.

1. Introduction The emergence of big data is mainly attributed to social networking applications, sensors, bioinformatics, e-business and similar applications. MapReduce [1], proposed by Google is a widely accepted framework for processing big data. Hadoop [2] is an open source implementation of MapReduce. In the world of big data, providing data management through clouds is highly relevant. Cloud computing provides virtually infinite instances of highly scalable and flexible resources on demand. As a consequence of the cloud computing model, the users’ operational expenditure tends to become proportional to the size and duration of the usage, further adding to its popularity. Industry and academia are involved in active research towards improving the performance of clouds. Nowadays, a wide range of applications for end users are available as services hosted in the cloud. Cloud computing provides services in virtualized environment. Hence, practically infinite resources can be provided as per the demands from the clients. The resources could be storage, networks, servers, applications, and services. NIST [3] defines cloud computing as “a model for enabling ubiquitous, 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” [3]. The main challenge in such a scenario is the proper placement of Virtual Machines (VMs) in Physical Machines (PMs) of the cloud provider.

R ∗

Reviews processed and recommended for publication to the Editor-in-Chief by Guest Editor Dr. R. Tolosana. Corresponding author. E-mail addresses: [email protected] (T. Shabeera), [email protected] (S. Madhu Kumar), [email protected] (P. Chandran).

http://dx.doi.org/10.1016/j.compeleceng.2016.10.009 0045-7906/© 2016 Elsevier Ltd. All rights reserved.

Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

JID: CAEE 2

ARTICLE IN PRESS

[m3Gsc;October 19, 2016;19:26]

T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

Fig. 1. MapReduce job execution in cloud environment.

Fig. 2. Common data center topology [8].

Providing Hadoop/MapReduce as a service generates several benefits for end users. With the MapReduce cloud model, even small organizations can analyze large amounts of data [4]. By using the MapReduce cloud, organizations and individuals can concentrate on ideas and innovations, instead of spending time on setting up and managing platforms. The end users’ involvement gets simplified to just entering input data and applying MapReduce queries. A profiler at the service provider’s side analyses each query and determines the optimal number of VMs required to process the query [5]. Hadoop/MapReduce is basically a batch processing system [6]. When MapReduce is provided as a service, the server systems handle multiple jobs and multiple users, thus deteriorating the performance of the MapReduce cloud. Since the data processed in MapReduce environment is very large, the number of VMs required is also high, and all these VMs call for data transfer between Map and Reduce phases. The job completion time depends strongly on the delay in data transfer. To curtail the job completion time, VMs should be allocated such that the data transfer time between the allocated VMs is minimum. Data transfer time depends on the number of switches between the communicating VMs and the processing delay of the switches. Data transfer time also depends on the bandwidth of the links between the communicating VMs. We define a parameter, distance between VMs, to represent the role of the contributing factors to the delay in data transfer between VMs. If the VMs are on the same PM, their distance will be zero. Otherwise the distance depends on the number of switches and links between them to represent the bandwidth and latency of the communication channel as defined in Section 3.1. As far as possible, the VMs should be allocated on the same PM or on adjacent PMs. Fig. 1 gives an overview of the MapReduce cloud. When a user submits a job, the profiler at the provider end analyses the job and determines the number of VMs required to process the job. The next phase allocates VMs in PMs that minimizes the inter-VM distance and executes the tasks of the job on these VMs. Finally, the produced output is sent back to the user. Allocating VMs with minimum inter VM distance is a major step towards improving the performance of MapReduce jobs in cloud. Since all the VMs are connected to each other (i.e. can potentially communicate with each other), this problem is equivalent to finding a minimum edge-weighted k-clique in a given weighted complete graph with demand of k. Current cloud data centers follow the popular topology shown in Fig. 2. We propose an approximation algorithm to allocate VMs for MapReduce clusters such that their inter VM distances are minimum assuming that the inter-VM distances satisfy triangular inequality. But, triangular inequality cannot be guaranteed in all cloud data centers [7]. We propose node set expansion algorithm for cloud data centers in which the inter-VM distances do not satisfy triangular inequality. Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

JID: CAEE

ARTICLE IN PRESS T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

[m3Gsc;October 19, 2016;19:26] 3

The rest of the paper is organized as follows: Section 2 reviews the different approaches of MapReduce in clouds and the methods available in the literature for efficient VM allocation. Section 3 describes our proposals on dynamic VM allocation. Section 4 gives the experimental evaluation and analysis of the results and Section 5 concludes the paper with future work. 2. Literature review Cloud computing provides infrastructure, platform, software etc. as services to the users in a pay-as-you-go model [3]. The resources in clouds are virtually infinite and scalable on demand. S. Mustafa et al. [9] provides a study on the resource management techniques in cloud computing based on different metrics. These metrics include energy efficiency, load balancing, Service Level Agreement (SLA) awareness, network load minimization, profit maximization among others. The authors in [10] review the challenges posed by big data on cloud computing. MapReduce [1] is a parallel programming model proposed by Google for processing huge amounts of distributed data. MapReduce has two major functions, namely, Map and Reduce. The Map phase processes the data parallely and produces the intermediate results. The Reduce phase takes these intermediate results as input and generates the final results. MapReduce clouds provide both storage and MapReduce computation as services. There are three different approaches for providing MapReduce as a cloud service, based on the implementation of storage nodes and compute nodes [11–15]. In the first approach, both storage nodes and computing nodes are VMs, but in the second approach, user data is stored in storage cloud and the processing is done on a compute cloud. In the third approach, data is stored in physical disk and computation is done by VMs placed on the same PMs on which the data is copied. When a user requests for a cluster, a set of VMs are allocated in the first approach. Users store their data on these VMs and do the processing. After processing, the results can be taken back by the user. VMs are shutdown after use. In the second approach, usually a storage area network (SAN) or network-attached storage (NAS) is used for data storage. When computation is to be done on this data, a set of VMs are allocated, data are copied to the VMs from the storage cloud and the computations are done on this data. The results are stored back to the storage cloud. Amazon Elastic MapReduce (Amazon EMR) [11] is an example of this kind of architecture. In Amazon EMR, data is distributed across Amazon Simple Storage Service (Amazon S3). These data are processed using Amazon Elastic Compute Cloud (Amazon EC2) clusters with Hadoop MapReduce framework. When a MapReduce job has to be performed, the data from S3 is copied to EC2 and processed. In this case, since the data size is huge, the data loading phase takes a long time and multiple copies of data exist at the same time (both in storage cloud and compute cloud). Another option for data processing is remote access. But in this case, if several VMs need to get the data from the same storage node, data transfer from that node becomes a bottleneck. In the third approach, sets of PMs are dedicated as MapReduce clusters. Data is stored in the physical storage devices. According to the processing capacity of each PM, a set of VMs are placed on these PMs to process the data stored in these PMs. VMs can access data from physical storage devices by attaching physical storage to the VM directly or by copying from the local disk to the VM. VM Placement, i.e. placing VMs on PMs is a widely studied topic [9]. The main objective of most of these studies are to consolidate the VMs on servers for energy efficiency and server utilization [16–21]. VM placement techniques are proposed based on methods like bin packing [16], metaheuristic algorithms [17,19,21], game theory [20], etc. Since the scenario discussed in these papers do not consider interactive VMs, these approaches do not consider distance between PMs as an optimization parameter while placing the VMs. For MapReduce applications, there is a sizeable data transfer between VMs while jobs execute. Hence inter-VM distance is a very important parameter to be considered in VM placement, since it affects the job completion time. Tziritas et al. [22] address two conflicting objectives, namely energy efficiency and network load minimization for VM placement. The authors propose algorithms for application aware workload consolidation, considering both energy efficiency and network load minimization, separately as well as together. But, the authors consider a cloud environment with an initial placement and try to optimize the VM placement by migration for achieving energy efficiency and network load minimization. The approach is to identify interdependent VMs and try to consolidate into a PM that minimizes energy utilization. But in a cloud environment that provides data intensive applications as a service, VM migration causes additional overhead. It is highly improbable that the large number of VMs required to create a MapReduce cluster could be consolidated in a single physical server. Alicherry and Lakshman [12] propose a heuristic algorithm for intelligent VM placement given the location of the data sets. Their algorithm aims to optimize the VM placement minimizing the data access latencies. Given a partial assignment of data nodes to VMs, the algorithm incrementally assigns more VMs to unassigned data nodes. The optimality of the cluster of VMs depends on the initial selection. Purlieus [13] allocates VMs in the same machines in which the data is stored. Data is stored in PMs and required number of VMs are allocated on the same PM. MapReduce clouds process very large amount of data and for processing these data sets, large number of VMs are required. In this approach too, the allocation of required number VMs on single PM may not be always possible because of the VM placement capacities of the PMs. CAM [14] uses a min-cost flow model for data and VM placement by considering storage utilization, changing CPU work loads and network link capacities. This approach considers both VM migration and delay scheduling. Delay scheduling adds additional overhead to MapReduce in clouds. If the VMs are migrated after starting execution of jobs, it results in increased job completion time. Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

ARTICLE IN PRESS

JID: CAEE 4

[m3Gsc;October 19, 2016;19:26]

T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

Cura [15] creates different classes of VM pools and allocates these pools on request. But in this approach, the VMs are preclustered and this potentially results in wastage of resources due to allocation of more resources than requested. If there are several small sized clusters and a client requests a large sized cluster that is not available, Cura cannot integrate these small sized clusters to form a large sized cluster. This could degrade the performance of the cloud, due to fragmentation of resources. Park et al. [23] proposes a method to dynamically increase or decrease the computing capability of nodes and improve the performance by locality-aware task scheduling. Increasing computational capability of nodes, while executing tasks is complicated, and might not be always possible in PMs which host multiple VMs running several MapReduce jobs. Maheshwari et al. [24] proposes an algorithm that dynamically reconfigures the cluster based on the current workload and turns the cluster nodes on or off when the average cluster utilization exceeds or falls below administrator specified thresholds respectively. The properties of the VMs are not considered for reconfiguration. Since the transmission delays are not considered while adding VMs, the method would not be suitable for MapReduce clouds. The objective of VM placement problem in [25] is cost minimization; where the cost includes both PM cost and network cost. The authors aim to place the VMs of the same tenants in same PM, so that the traffic between PMs after placement is minimized. But the number of VMs required for a tenant executing big data application may be high and that may require more than one PM. The network delays between PMs for placing the VMs of the same tenant is not considered as a parameter for optimization. Shabeera and Madhu Kumar [26] propose three algorithms, namely greedy allocation algorithm, Partition Around Medoid (PAM) algorithm and random allocation algorithm for VM allocation in MapReduce cloud. The greedy allocation algorithm repeatedly picks the minimum cost edge and finds the nearest VMs until the demand is satisfied. The random allocation algorithm randomly picks one VM and finds the nearest k − 1 VMs to satisfy the demand. The PAM algorithm randomly picks k VMs initially, and then apply heuristics to improve this selection. These three algorithms cannot guarantee a global optimal solution. Execution time of MapReduce jobs depends on data transfer delay between the VMs in the cluster. Since the data size is huge, the distance between the processing VMs has a major impact on this delay. We aim at an allocation of VMs for MapReduce/Hadoop cluster that minimizes data transfer delay and thereby curtails the job completion time.

3. Dynamic Virtual Machine allocation For executing MapReduce jobs in cloud, virtual clusters are created with VMs and these VMs require inter-VM data transfer. The delay in data transfer leads to increase in job completion time and hence affect the throughput and SLA. If the VMs are in same PM, the data transfer delay between VMs are negligible. If the number of VMs required for a MapReduce job is greater that the VM placement capacity of single PM, more than one PMs have to be selected. In this case, the VMs have to be selected such that the data transfer time is minimized. To select VMs so as to minimize delays due to data transfer, we define two concepts - proximity levels of VMs and distance between them, and use the distance as the parameter to be optimized in our algorithms.

3.1. Proximity levels and distance between VMs To minimize network delay and data transfer cost, VMs of the same job should be allocated in same PM or PMs accessible with minimal delay. The proximity level of VMs is defined considering the expected number of switches connecting the VMs, the processing delay of the switches, the bandwidth and latency of the channel connecting the VMs. On a scale of 0–4, we define proximity levels as follows: • • • • •

If If If If If

the the the the the

VMs VMs VMs VMs VMs

are are are are are

in in in in in

same PM, the VMs are in proximity level 0. different PMs in same rack, the VMs are in proximity level 1. different PMs in different racks, the VMs are in proximity level 2. different PMs in different data centers, the VMs are in proximity level 3. different data centers of different cloud providers, they are in proximity level 4.

Distance between two VMs is a function of underlying network latency and bandwidth between the PMs hosting the two VMs. Let bandHS denote the bandwidth of the host to switch channel, bandSSi denote the bandwidth of the switch to switch channel at proximity level i, LHS denote host to switch latency, and LSSi denote switch to switch latency at proximity level i. If the VMs are in proximity level 0, the delay between VMs is expected to be negligible and the distances between these VMs are defined as 0. Otherwise, the delay between VMs depends on the cloud providers’ data center architectures, and the values of the latencies and bandwidths as given in the providers’ network hardware specifications. For example, for the popular data center topology shown in Fig. 2, the host to switch links are GigE and the links between switches are 10 GigE

Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

ARTICLE IN PRESS

JID: CAEE

T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

[m3Gsc;October 19, 2016;19:26] 5

[8], and we define distance for this topology as:

Distance =

⎧ 0, ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪  ⎪ ⎪ ⎪ ⎨2 ×

At proximity level 0



1 + LHS , bandHS At proximity level 1

⎪ ⎪

⎪  1   ⎪ ⎪ 1 ⎪ ⎪ 2 × + L + 2 × + L HS SSi , ⎪ i ⎪ bandHS bandSSi ⎪ ⎩ At proximity level i > 1

The distance function can be appropriately adapted for the network architecture topology of the provider’s network. Our algorithms, being generic to distance function, can be adapted to any topology. The algorithms takes distance matrix as input. The distance matrix is defined as a matrix containing the pairwise distances between VMs. Given the distance matrix for n VMs, we define the problem of dynamic VM allocation for a MapReduce cluster, and prove it to be NP-Hard in the following subsection. 3.2. Dynamic Virtual Machine Allocation (DynVMAlloc) problem Let V be the set of n VMs connected according to the topology shown in Fig. 2 and D be the distance matrix that shows the distance between VMs in the MapReduce cloud where dij denotes the distance between Vi and Vj . Suppose we require k VMs to create a virtual cluster. Dynamic Virtual Machine Allocation (DynVMAlloc) problem is to pick a subset U⊆V such that |U | = k and  u, v ∈ U duv is minimum. The Integer Programming (IP) formulation for the DynVMAlloc problem is given below: The binary variable xi = 1, if the VM Vi is chosen for the cluster and 0 otherwise.

Minimize

n n

di j (xi .x j )

i=1 j=i

subject to

n

xi = k

i=1

xi ∈ {0, 1}, 1 ≤ i ≤ n Theorem 1. DynVMAlloc is NP-Hard. Proof. We show that the k-clique problem in graph theory is reducible to DynVMAlloc problem. i.e. for any instance of k-clique, an instance of the DynVMAlloc can be created in polynomial time such that solving the instance of DynVMAlloc solves the instance of k-clique as well. From the NP-completeness property of the k-clique problem, which is already proven in literature [27], DynVMAlloc problem can be proven as NP-hard [28]. k-clique problem: Given a graph G(V, E) and an integer k, decide whether G has a clique of size k. Let G = (V, E, k ) be an instance of k-clique, where V = {1, 2, .., n}, E = V × V, and k is a positive integer. We can define an instance of DynVMAlloc as follows: DV = (V, d, k ), where V = {1, 2, .., n}, d : V × V → Q+ ∪ {0}, and k is a positive integer. We can reduce an instance of the k-clique to DynVMAlloc as follows: Construct a VM corresponding to each vertex in the k-clique instance G. For VMs corresponding to i and j, dij is assigned as:



di j =

0 1

if (i, j ) ∈ E otherwise

 We claim that, clique of order k exists if and only if DV contains a subset DV such that |DV  | = k and u,v∈DV  duv = 0. Suppose we have given a k-clique instance as shown in Fig. 3. We can construct the DynVMAlloc instance from this with vertices 1, 2, 3, 4, 5, 6. The distance matrix D is as shown in Table 1. We can see that in this example, the k-clique instance has a clique of size 3 and the DynVMAlloc has a solution with  k=3 and u,v∈DV  duv = 0. Existence of k-clique is the necessary and sufficient for DynVMAlloc to have a solution of size k with minimum sum of distances. Hence the proof.  3.3. Approximation algorithm for Virtual Machine allocation This subsection gives the approximation algorithm we have proposed for Virtual Machine allocation for MapReduce in cloud. We assume the distance matrix satisfies triangular inequality. Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

ARTICLE IN PRESS

JID: CAEE 6

[m3Gsc;October 19, 2016;19:26]

T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

Fig. 3. k-clique instance. Table 1 DynVMAlloc instance.

1 2 3 4 5 6

1

2

3

4

5

6

0 0 0 0 1 1

0 0 0 1 0 1

0 0 0 1 1 0

0 1 1 0 0 1

1 0 1 0 0 0

1 1 0 1 0 0

Algorithm 1: Approximation algorithm. Input: Number of VMs: k, Distance Matrix: D Output: A Cluster of VMs of size k 1: for every vertex v ∈ V do 2: Find S(v ), the closest k vertices from v including v  C ( v ) = w∈S ( v ) d ( v, w ) 3: 4: end for 5: Find MinvC (v ) and assign the set to MinSet 6: Find Sum of distances between vertices in MinSet and assign to MinCost 7: Mark all these k VMs as busy

Algorithm 1 considers the VMs as vertices in a graph and the distances between VMs as costs of edges between the corresponding vertices. The algorithm first finds the closest k VMs from every VM by adding the costs of edges between every pair of vertices in the set. For the vertex Vi , the set is denoted by S(Vi ) and the cost is denoted by C(Vi ). After that, Step 5 of the algorithm finds the minimum cost among them and choose the corresponding set as the closest k vertices. For example, if C(Vj ) is minimum, the corresponding set S(Vj ) is selected. If any PM has enough VMs to satisfy the requirement, those VMs in proximity level 0 are allocated. Otherwise, it will go for next higher levels. Theorem 2. Algorithm 1 solves the DynVMAlloc problem with an approximation factor of 2. Proof. Let n be the number of VMs. Algorithm 1 first finds the closest k vertices of first vertex. If we use the best algorithm for finding nearest k vertices, this will take O(n) time. This process should be repeated for all the vertices. So for n vertices, time required is n × n. Hence the time complexity of Algorithm 1 is O(n2 ). Our solution is MinSet and the sum of distances between VMs in MinSet is MinCost. Let the optimal solution be MinSet∗ with sum of distances MinCost∗ . The sum of distances in optimal solution is:

MinCost ∗ = ≤ =

1 2 1 2 1 2





d (i, j )

i∈MinSet ∗ j∈MinSet ∗





d (i, j )

i∈MinSet ∗ j∈MinSet

i∈MinSet ∗

C (i ) ≥

1 2

i∈MinSet ∗

MinC ost =

k ∗ MinC ost. 2

Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

ARTICLE IN PRESS

JID: CAEE

T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

[m3Gsc;October 19, 2016;19:26] 7

The sum of the distances in our solution, MinSet is:

MinCost =

1 2





d (i, j ).

i∈MinSet j∈MinSet

Let v be the value for which we get the minimum sum of distances, MinCost. By triangular inequality,





d (i, j ) ≤

i∈MinSet j∈MinSet





(d (i, v ) + d (v, j ))

i∈MinSet j∈MinSet

=





i∈MinSet j∈MinSet

=

j∈MinSet



= k∗



d ( v, j )

i∈MinSet j∈MinSet

 d (i, v )

i∈MinSet





d (i, v ) +

d (i, v )



+

i∈MinSet





+k∗

i∈MinSet

j∈MinSet

 d ( v, j )



d ( j, v )

j∈MinSet

= k ∗ MinCost + k ∗ MinCost Therefore the sum of the distances in our solution is,

1 ∗ 2kMinCost = k ∗ MinCost. 2 The approximation factor of our algorithm,

α= =

MinCostalgorithm MinCostOptimal k ∗ MinCost = 2. k ∗ MinCost 2

Hence Algorithm 1 is a 2-Approximation algorithm.



3.4. Node set expansion algorithm for Virtual Machine allocation Algorithm 1 assumes that the distance matrix satisfies triangular inequality. Triangular inequality cannot be guaranteed in all cloud data centers [7,29]. In this subsection, we propose an algorithm, Node Set Expansion Algorithm for dynamic VM allocation for data centers in which the distances between VMs do not satisfy triangular inequality. We know the minimum distance and maximum distance between any two VMs in advance. Node Set Expansion Algorithm uses threshold to hold the distance value for selecting the nodes to be added. Since we have to choose nodes such that the sum of their distances are minimum, Algorithm 2 starts with the minimum distance as threshold. Two nodes connected by an edge with weight threshold is selected. Then the algorithm calls Algorithm 3 for adding more nodes. Algorithm 2: Node set expansion algorithm. Input: Number of VMs: k, Complete weighted graph, G Output: clique of size k with minimum weight 1: threshold=Mindist 2: U = V 3: S = φ 4: Choose u, v ∈ U such that duv is threshold. 5: Add u, v to S 6: if S == φ increment threshold else goto 8 7: if threshold > Maxdist goto 11 else goto 2 8: Remove u, v from U 9: Expand (S ) 10: if |S| ≥ k return S else goto 3 11: exit

Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

ARTICLE IN PRESS

JID: CAEE 8

[m3Gsc;October 19, 2016;19:26]

T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

Algorithm 3: Expand(S). repeat Find v ∈ V − S such that for each w ∈ S, dwv ≤ threshold 3: Add v to S 4: Remove v from U 5: until v is empty or |S| ≥ k 1:

2:

Table 2 Distance matrix.

V1 V2 V3 V4 V5 V6 V7 V8 V9 V10

V1

V2

V3

V4

V5

V6

V7

V8

V9

V10

0 0.289 0.289 0.289 0.706 0.706 0.706 1.18 1.18 1.18

0.289 0 0.289 0.289 0.706 0.706 0.706 1.18 1.18 1.18

0.289 0.289 0 0.289 0.706 0.706 0.706 1.18 1.18 1.18

0.289 0.289 0.289 0 0.706 0.706 0.706 1.18 1.18 1.18

0.706 0.706 0.706 0.706 0 0.706 0.706 1.18 1.18 1.18

0.706 0.706 0.706 0.706 0.706 0 0.706 1.18 1.18 1.18

0.706 0.706 0.706 0.706 0.706 0.706 0 1.18 1.18 1.18

1.18 1.18 1.18 1.18 1.18 1.18 1.18 0 1.18 1.18

1.18 1.18 1.18 1.18 1.18 1.18 1.18 1.18 0 1.18

1.18 1.18 1.18 1.18 1.18 1.18 1.18 1.18 1.18 0

Algorithm 3 adds vertices with the given threshold distance. If the set can expand to the given size k, it will be returned. If the set cannot be expanded to k, the algorithm will check whether there is any other edge that can be expanded with this distance. If not, the distance value will be incremented and the process will be repeated until it expands to a size k or it reaches the maximum distance, Maxdist. Since k ≤ n, the algorithm will return a set with k VMs. Proof of correctness. Algorithm 2 returns the set S with threshold t means that we could not have a set S of size at least k with threshold value less than t.   Let S1 be a set such that |S1 | ≥ k and u,v∈S1 < i, j∈S . Let t1 be the threshold value of the set S1 and t be the threshold value of the set S. Since we are starting from Mindist value and increment in uniform order until we get a set S such that |S| ≥ k and k ≤ n, we will exit when we get the best possible set. For the set S, we start from Mindist and expand S. Let Mindist < t1 < t. Since S couldn’t expand to k with Mindist, the algorithm will increment threshold and expand. The process will repeat. When threshold = t1 , the set S will expand to size ≥ k and the algorithm will exit. This contradicts the assumption.  The following section presents the experimental evaluation of the proposed algorithms. 4. Experimental evaluation In a MapReduce cluster, data transfer occurs between Map and Reduce phases during job execution. For queries like join, data transfer may occur between tasks in the same phase. Job completion time depends on the configuration of the nodes on which the tasks of the job are executing. In addition to this, since there is data transfer between different phases of MapReduce execution, the data transfer delay between the nodes executing the tasks also has impact on the job completion time. We are considering a virtualized environment, in which all the servers are virtualized and contains multiple VMs, based on the VM allocation capacity of that server. These servers are arranged in racks that are distributed across multiple data centers. In this environment, the nodes allocated for creating the cluster will be a set of VMs. The cluster size (number of VMs) depends on the requirement from the client. In our experiment, we study the impact of distance between VMs on job completion time. We have created three clusters for this experiment, based on the delay between VMs. V1 , V2 , V3 , V4 are the VMs in Cluster 1, V1 , V5 , V6 , V7 are the VMs in Cluster 2, and V1 , V8 , V9 , V10 are the VMs in Cluster 3. The distance between these VMs shown in Table 2 are the ping delay between these VMs. All the VMs are homogeneous with the same configuration (2 core, 2GB RAM and 500 GB disk). All VMs are installed with Hadoop on Ubuntu 14.04. We have executed three MapReduce programs, TeraGen, TeraSort and WordCount [2,6] in these three clusters and measured the execution time of each job. Figs. 4–6 give the execution time of TeraGen, TeraSort and WordCount respectively in the three clusters of our experimental setup. Fig. 4 shows the result of executing MapReduce program for generating 1GB and 10GB of data and writing to the cluster. This program is an example of output heavy program. Fig. 5 shows the result of MapReduce program for sorting 1GB and 10GB of data generated by TeraGen. This is an example of a program with heavy, equal sized input and output. Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

JID: CAEE

ARTICLE IN PRESS T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

[m3Gsc;October 19, 2016;19:26] 9

Fig. 4. Execution time of TeraGen.

Fig. 5. Execution time of TeraSort.

Fig. 6 shows the result of executing MapReduce program for WordCount. Here the input size of the data is 1GB and 10GB. This program is an example of program with heavy input and comparatively small output. All the results show that the execution time of jobs depends on the distance between VMs in the cluster. Cluster 1 takes less time to complete the MapReduce job execution compared to Cluster 2 and Cluster 2 takes less time to complete the MapReduce job execution compared to Cluster 3. Big data consists of TeraBytes/PetaBytes of data. Since data transfer between VMs which execute Map/Reduce tasks is needed, the job execution time will increase depending on the distance between VMs and size of the data being processed. So while allocating VMs for MapReduce/Hadoop cluster, adjacent VMs should be selected. We have proposed algorithms for allocating VMs for MapReduce/Hadoop cluster that minimizes the sum of distances between selected VMs, and hence it will reduce the MapReduce job execution time. We have simulated and compared various VM allocation algorithms in the popular cloud simulation platform, CloudSim [30]. CloudSim is installed in an IBM System x3100 M4 with Intel Xeon E3-1220 processor operating at 3.10 GHz. We have compared our algorithms with the existing algorithms in literature, namely greedy allocation algorithm and random allocation algorithm [26]. Greedy allocation algorithm picks the minimum cost edge and finds the nearest VMs till the demand is satisfied. The random allocation algorithm randomly picks one VM and finds the nearest k − 1 VMs to satisfy the demand. When a MapReduce job is submitted, the job is analyzed by the profiler phase, and the profiler gives the required number of VMs to process the job as output. This number is referred to as the demand in our algorithm denoted by k. If the data Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

JID: CAEE 10

ARTICLE IN PRESS

[m3Gsc;October 19, 2016;19:26]

T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

Fig. 6. Execution time of WordCount.

Fig. 7. Sum of the distances between VMs.

Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

JID: CAEE

ARTICLE IN PRESS T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

[m3Gsc;October 19, 2016;19:26] 11

Fig. 8. Sum of the distances between VMs.

center architecture satisfies triangular inequality, we can use Algorithm 1 and if it is not satisfied, we can use Algorithm 2. For the first case, distance matrices which satisfy triangular inequality are given as input. For the second case distance matrices which do not satisfy triangular inequality are given as input. We have simulated the greedy, random, and approximation algorithms for data centers in which the distances between VMs satisfy triangular inequality. We have also simulated greedy, random and node set expansion algorithms for data centers in which the distances between VMs do not satisfy triangular inequality. In both the experiments, the size of the data centers were varied from 1 to 100 and given requests for 10 VMs, 50 VMs and 100 VMs. We have taken the average value of 50 trial runs. The sum of the distances between the selected nodes are compared in each case. Fig. 7(a) gives the sum of distances between allocated VMs for a request of 10 VMs for data center sizes varying from 10 to 100. Fig. 7(b) and (c) gives the results for requests of 50 VMs and 100 VMs respectively. Fig. 8(a), (b) and (c) gives the sum of the distances between allocated VMs for data centers in which the distances between VMs do not satisfy triangular inequality for a request of 10 VMs, 50 VMs and 100 VMs respectively. Here also the data center sizes are varied from 10 to 100. From the first experiment, it is clear that if the VMs are allocated in close proximity, job completion time will be curtailed. If the distance matrix satisfies triangular inequality, the approximation algorithm allocates VMs in close proximity. The node set expansion algorithm allocates VMs in close proximity, if the distance matrix does not satisfy triangular inequality. So allocating VMs for MapReduce clusters using these algorithms and executing jobs on these clusters reduce the job completion time. Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

JID: CAEE 12

ARTICLE IN PRESS

[m3Gsc;October 19, 2016;19:26]

T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

From these results we can see that our algorithm outperforms the greedy and random algorithms. We can also see that the sum of the distance increases with the increase in the number of data centers in existing algorithms. But, our algorithm always chooses the best possible set of VMs to create the cluster. 5. Conclusion Providing big data processing platforms through clouds give several benefits to the end users. As the cloud environment is virtualized, a set of VMs are allocated for each user who requests for the service. The allocation of VMs have a great impact on the performance of the MapReduce jobs assigned on these VMs. The major contribution of this paper are algorithms for VM allocation with minimum possible inter VM distances, specifically an approximation algorithm with an approximation factor 2, for data centers in which the distances between VMs satisfy triangular inequality and node set expansion algorithm for those data centers in which the inter-VM distances do not satisfy triangular inequality. Experimental results show that the MapReduce jobs allocated to VMs that are in close proximity complete execution faster than VMs in distant PMs. The algorithms proposed in this paper allocates VMs, minimizing inter-VM distances compared to other allocation schemes. Hence, if the jobs are executed in the VMs allocated by the proposed algorithms, the job completion time will be curtailed. In this paper, we consider homogeneous VMs only. We would like to extend this work for heterogeneous environments in which the clients specify the types of VMs and the required number of VMs in each type so that the algorithm can be used in any type of cloud environment. References [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30]

Dean J, Ghemawat S. Mapreduce: simplified data processing on large clusters. Commun ACM 2008;51(1):107–13. Apache hadoop. http://hadoop.apache.org, [Accessed: 15 May]. Mell P, Grance T. The nist definition of cloud computing. Commun ACM 2010;53(6):50. Di Martino B, Aversa R, Cretella G, Esposito A, Kołodziej J. Big data (lost) in the cloud. Int J Big Data Intell 2014;1(1–2):3–17. Herodotou H, Babu S. Profiling, what-if analysis, and cost-based optimization of mapreduce programs. Proc VLDB Endowment 2011;4(11):1111–22. White T. Hadoop: the definitive guide. 3 ed. O’Reilly Media, Inc.; 2012. Mao Y, Saul LK, Smith JM. Ides: an internet distance estimation service for large networks. Sel Areas Commun IEEE J 2006;24(12):2273–84. Al-Fares M, Loukissas A, Vahdat A. A scalable, commodity data center network architecture. ACM SIGCOMM Comput Commun Rev 2008;38(4):63–74. Mustafa S, Nazir B, Hayat A, Madani SA, Khan AuR. Resource management in cloud computing: taxonomy, prospects, and challenges. Comput Electr Eng 2015;47:186–203. Hashem IAT, Yaqoob I, Anuar NB, Mokhtar S, Gani A, Khan SU. The rise of “big data” on cloud computing: review and open research issues. Inf Syst 2015;47:98–115. EMR A. Amazon elastic mapreduce. http://aws.amazon.com/elasticmapreduce/; 2015. [Accessed: 15 May 2015]. Alicherry M, Lakshman T. Optimizing data access latencies in cloud systems by intelligent virtual machine placement. In: Proceedings of INFOCOM. IEEE; 2013. p. 647–55. Palanisamy B, Singh A, Liu L, Jain B. Purlieus: locality-aware resource allocation for mapreduce in a cloud. In: Proceedings of 2011 international conference for high performance computing, networking, storage and analysis. ACM; 2011. p. 1–11. Li M, Subhraveti D, Butt AR, Khasymski A, Sarkar P. Cam: a topology aware minimum cost flow based resource manager for mapreduce applications in the cloud. In: Proceedings of the 21st international symposium on high-performance parallel and distributed computing. ACM; 2012. p. 211–22. Palanisamy B, Singh A, Langston B. Cura: A cost-optimized model for mapreduce in a cloud. In: Parallel & distributed processing (IPDPS), 2013 IEEE 27th international symposium on. IEEE; 2013. p. 1275–86. Beloglazov A, Abawajy J, Buyya R. Energy-aware resource allocation heuristics for efficient management of data centers for cloud computing. Future Gener Comput Syst 2012;28(5):755–68. Gao Y, Guan H, Qi Z, Hou Y, Liu L. A multi-objective ant colony system algorithm for virtual machine placement in cloud computing. J Comput Syst Sci 2013;79(8):1230–42. Khani H, Latifi A, Yazdani N, Mohammadi S. Distributed consolidation of virtual machines for power efficiency in heterogeneous cloud data centers. Comput Electr Eng 2015;47:173–85. Dashti SE, Rahmani AM. Dynamic vms placement for energy efficiency by pso in cloud computing. J Exp Theor Artif Intell 2015:1–16. Xiao Z, Jiang J, Zhu Y, Ming Z, Zhong S, Cai S. A solution of dynamic vms placement problem for energy consumption optimization based on evolutionary game theory. J Syst Software 2015;101:260–72. Wu G, Tang M, Tian Y-C, Li W. Energy-efficient virtual machine placement in data centers by genetic algorithm. In: Neural information processing. Springer; 2012. p. 315–23. Tziritas N, Xu C-Z, Loukopoulos T, Khan SU, Yu Z. Application-aware workload consolidation to minimize both energy consumption and network load in cloud environments. In: Parallel processing (ICPP), 2013 42nd international conference on. IEEE; 2013. p. 449–57. Park J, Lee D, Kim B, Huh J, Maeng S. Locality-aware dynamic vm reconfiguration on mapreduce clouds. In: Proceedings of the 21st international symposium on high-performance parallel and distributed computing. ACM; 2012. p. 27–36. Maheshwari N, Nanduri R, Varma V. Dynamic energy efficient data placement and cluster reconfiguration algorithm for mapreduce framework. Future Gener Comput Syst 2012;28(1):119–27. Li X, Wu J, Tang S, Lu S. Let’s stay together: Towards traffic aware virtual machine placement in data centers. In: IEEE INFOCOM 2014-IEEE conference on computer communications. IEEE; 2014. p. 1842–50. Shabeera T, Madhu Kumar S. Optimising virtual machine allocation in mapreduce cloud for improved data locality. Int J of Big Data Intell 2015;2(1):2–8. Karp RM. Reducibility among combinatorial problems. Springer; 1972. Michael RG, David SJ. Computers and intractability: a guide to the theory of NP-completeness. WH Freeman & Co., San Francisco; 1979. Lee G. Cloud networking: understanding cloud-Based data center networks. 1 ed. Morgan Kaufmann; 2014. Calheiros RN, Ranjan R, Beloglazov A, De Rose CA, Buyya R. Cloudsim: a toolkit for modeling and simulation of cloud computing environments and evaluation of resource provisioning algorithms. Software: Pract Experience 2011;41(1):23–50.

Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009

JID: CAEE

ARTICLE IN PRESS T. Shabeera et al. / Computers and Electrical Engineering 000 (2016) 1–13

[m3Gsc;October 19, 2016;19:26] 13

T P Shabeera is a Research Scholar in the Department of Computer Science and Engineering, National Institute of Technology Calicut. She received her M.Tech in Computer Science and Engineering from National Institute of Technology Calicut. Her research interests include Cloud Computing and Big Data Management. S D Madhu Kumar is an Associate Professor in the Department of Computer Science and Engineering, National Institute of Technology Calicut. He received his PhD in CSE from Indian Institute of Technology Bombay. He is a senior member of IEEE and a member of ACM. His research interests include Cloud Computing, Databases, Software Engineering and Distributed Computing. Priya Chandran is a Professor in the Department of Computer Science and Engineering, National Institute of Technology Calicut. She did her Ph.D from Indian Institute of Science, Bangalore. Her areas of interest include Computer Architecture, Algorithms and Complexity, Virtualization and Security.

Please cite this article as: T. Shabeera et al., Curtailing job completion time in MapReduce clouds through improved Virtual Machine allocation, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.10.009