Bi-direction Adjust Heuristic for Workflow Scheduling in Clouds

1 downloads 614 Views 622KB Size Report
Email: [email protected]. Abstract—This paper considers the workflow scheduling prob- lem in Clouds with the hourly charging model and data transfer times.
2013 2013 19th IEEE International International Conference Conference on Parallel on Parallel and Distributed and Distributed Systems Systems

Bi-direction adjust heuristic for Workflow Scheduling in Clouds Zhicheng Cai∗ , Xiaoping Li∗ , Long Chen∗ , Jatinder N. D. Gupta†

∗ Computer

Science and Engineering, Southeast University, Nanjing, China Email: [email protected], [email protected], [email protected] † College of Business Administration University of Alabama in Huntsville Huntsville, USA Email: [email protected] Clouds such as Amazon Cloud. Tasks must be allocated to standard, high-CPU or high-memory VM instances based on their characteristics of tasks. In addition, the practical hourly charging strategy of real Clouds should not be ignored. Time fractions produced by previous tasks can be used by latter tasks to save VM renting cost. All of these factors make the task-resource mapping problem hard to solve.

Abstract—This paper considers the workflow scheduling problem in Clouds with the hourly charging model and data transfer times. It deals with the allocation of tasks to suitable VM instances while maintaining the precedence constraints on one hand and meeting the workflow deadline on the other.A bidirection adjust heuristic (BDA) is proposed for the considered problem.Matching of tasks and the VM types is modeled as Mixed Integer Linear programming (MILP) problem and solved using CPLEX at the first stage of BDA.In the second stage, forward and backward scheduling procedures are applied to allocate tasks to VM instances according to the result of the first stage. In the backward scheduling procedure, a priority rule considering the finish time, wasted time fractions and added hours is developed to make appropriate matches of tasks and free time slots. Extensive experimental results show that the proposed BDA heuristic outperforms the existing state-of-the-art heuristic ICPCP in all cases. Further, compared with ICPCP, about 80% percentage of VM renting cost is saved for instances with 900 tasks at most.

Recently, many companies and institutes have been trying to deploy their real-time analytic or online advertising industry applications to existing commercial Clouds. Tasks of these applications are usually modeled as workflows, in which data transfers among parallel or sequential software units. Workflows are always denoted by Directed Acyclic Graphs (DAG), in which nodes represent tasks and arcs represent precedence relations (such as data dependency) between tasks. Further, for most applications, deadlines exist. Therefore, in order to strike a balance between resource renting cost and workflow makespan, cloud users should allocate workflow tasks to appropriate VM instances.

Keywords—cloud computing, workflow scheduling, time cost tradeoff, virtual machine scheduling, bi-direction adjust.

I.

For DAG based task scheduling which is known to be NP-hard[1], there have been many related works involving homogeneous [2] and heterogeneous distributed systems [3]. These research efforts are aimed at maximizing the utilization of fixed number of resources from the perspective of the service providers. For customer-oriented resource renting cost minimization, Byun et al. [4] allocates fixed number of resources to the whole lifespan of the workflow. But in this paper, resources can be acquired at any time and released when they are idle, saving renting cost. Available heuristics for the considered problem, MDP [5], DET [6], and PCP [7] did not include the hourly charging strategy or data transfer times, which inevitably affect the effectiveness of the algorithms. Later, based on MDP [5], Mao et al. [8] proposed a new heuristic to allocate resource for an online multi-workflow application, which mainly focuses on the parallel execution of multiple workflows. Recently, a heuristic ICPCP that considers the hourly charging strategy was proposed by Abrishami et al. [9]. This heuristic assumes that data transfer time is a fixed number and is added to the execution time directly. Metaheuristics [10], [11], [12] are rather time-consuming, especially for complex applications and most of which do not consider the hourly charging strategy and data transfer times.

I NTRODUCTION

Mapping computation or storage tasks to appropriate purchased underlying resources in Clouds is challenging for cloud users. Auto-scaling nature (acquire or release appropriate types and numbers of resources according to the application volumes at any time and being charged on what they used) of Clouds provides more flexibilities in resource provisioning. Resource under-provisioning will decrease the performance of the system, which may result in over due events. However, resource over-provisioning can lead to idle time slots, incurring unnecessary cost. Therefore, users need to develop an appropriate resource auto-scaling strategy to save renting cost while guaranteing the system performance. The resource provisioning and allocation problem for workflow scheduling in a cloud environment is quite difficult to solve due to several task complexities. For example, for workflow tasks, relationships among sub-tasks must be considered during the resource allocation. Different characteristics (computation-intensive, memory-intensive or I/O intensive) of tasks make the problem more complicated. Multiple types of Virtual Machines (VMs), each of which has distinct configuration (number of virtual cores, CPU frequency, memory size and I/O bandwidth) and price, are provided by many commercial 1521-9097/13 $31.00 $26.00 © 2013 IEEE DOI 10.1109/ICPADS.2013.25 10.1109/.24

In this paper, we consider the minimization of resource 94

renting cost over unbounded dynamic resources in Clouds for executing a workflow with a given due date from the perspective of customers. We assume that data transfer time is zero when both tasks are executed on the same VM instance, otherwise, it is not ignorable. In view of the NP-hard nature of the problem, we develop and empirically test a Bi-Direction Adjust Heuristic (BDA) to solve this problem. The proposed huristic consists of two stages. In the first stage, tasks are allocated to appropriate VM types by ignoring the hourly charging strategy and solved by CPLEX to get a schedule Sf irst . In the second stage, matches of tasks and VM instances are determined according to the schedule Sf irst of the first stage. In the forward scheduling procedure of the second stage, each task is scheduled to begin just at the latest finish time of its predecessors according to the schedule Sf irst , which inevitably produces many wasted time fractions. In order to eliminate or reduce such wasted time fractions, a backward scheduling procedure is applied, in which all tasks are adjusted to appropriate free time slots of VM instances with specific types between their earliest start time and latest finish times. During this backward scheduling procedure, in order to make better matches of tasks and existing free time slots, a priority rule is developed to consider task finish time, wasted time fractions, and added rented hours. The performance of the proposed BDA is empirically compared with the existing stateof-the art heuristic ICPCP. Experiment results show that BDA outperforms the ICPCP for all cases where often VM renting cost is reduced by 80%.







 Minimum resource renting cost˛

A workflow instance of real-time analytics or online advertising industries Cloud users

Rent Virtual machines to construct a Virtual Cluster IaaS Provider (e.g., Amazon AWS)

Fig. 1.

Architecture of the considered Clouds



3



3

9

6

 Fig. 2.

 2

3

5

  



2





2

An illustrative example workflow TABLE I.

The rest of the paper is organized as follows. Section II describes the workflow scheduling problem in detail. Section III presents the proposed BDA, the complexity analysis, and an illustrative example. Experimental results are given in Section IV, followed by conclusions in Section V. II.

 

VM Type

C ONFIGURATIONS AND P RICES FOR VM S Configration

Price per hour

1.7 GB MEM, 1 EC2 CU 3.75 GB MEM, 2 EC2 CU 7.5 GB MEM, 4 EC2 CU 15 GB MEM, 8 EC2 CU

$0.060 $0.15 $0.36 $0.9

Normal types Small (N S) Medium(N M) Large(N L) Extra Large(N EL)

PROBLEM DESCRIPTION

High-memory types

In this section, after stating the assumptions on application tasks and cloud resources, we model the scheduling problem in detail. In the considered Clouds, there are two roles: the cloud provider and the cloud user as shown in Figure 1. The cloud provider (such as Infrastructure as a Service (IaaS) provider) supplies services (such as VMs and storage) to cloud users. The cloud users rent resources from cloud providers to establish their own virtual clusters to serve their applications. The objective of cloud users is to minimize the resource renting cost through the auto-scaling mechanism while meeting the application deadlines.

Extra Large(M EL) 17.1 GB MEM 6.5 EC2 CU $0.8 Double Extra Large(M DEL) 34.2 GB MEM 13 EC2 CU $1.9 Quadruple Extra Large(M QEL) 68.4 GB MEM 26 EC2 CU $4.3 High-CPU types Medium(C M) Extra Large(C EL)

1.7 GB MEM 5 EC2 CU 7 GB MEM 20 EC2 CU

$0.145 $0.87

same workflow, usually belong to the same Cloud provider and are deployed at nearly the same physical environment. Therefore, the data transfer time of each task is a fixed value irrespective of VM instance used for its execution. But, when both task and its immediate predecessors are executed on the same VM instance, data transfer time is equal to zero. In this paper, we assume that data transfer time for each task Vi is labeled as DTi . For example, in the workflow of Figure 2, integer numbers on the arcs denote the data transfer times in minutes.

1) Application tasks: Workflows are often used to model the cloud application tasks of many fields such as real-time analytics or online advertising industries. Workflows are depicted by a Directed Acyclic Graph (DAG),G = {V, E} where V = {V0 , V1 , . . . , VN } is the set of tasks of the workflow, E = {(i, j)|i < j} is the precedence constraints of tasks(such as data transfer dependency), which indicates that Vj cannot start until Vi completes, Pi and £i represents the immediate predecessor set and the immediate successor set of Vi , and path(i, j) = 1 means that there exists a path from Vi to Vj , otherwise, path(i, j) = 0. Figure 2 depicts a workflow example with seven activities (V0 and V8 are dummy source and sink nodes). Data transforation among tasks needs time, which is not ignorable. VM instances executing tasks of the

2) Cloud resources: Different types of Virtual Machines (with distinct price per hour) are provided by many existing commercial Clouds. Prices are not always linear to the configuration of the VM instances. Table I gives the configurations and prices of different types of VM used in this paper and Tt , t = 1, 2, ..., M denotes the tth type of VM, P rice(t) represents the price per hour of the VM type Tt . As mentioned

95

TABLE II.

N S N M N L N EL M EL M DEL M QEL C M C EL

V2

V1

VM type

E XECUTION TIMES AND COSTS OF TASKS IN F IGURE 2 V3

V4

V5

V6

V7

time(m)

cost($)

time(m)

cost($)

time(m)

cost($)

time(m)

cost($)

time(m)

cost($)

time(m)

cost($)

time(m)

cost($)

138 69 34 17 21 10 5 27 6

0.14 0.17 0.20 0.26 0.28 0.32 0.36 0.07 0.09

86 43 21 10 13 6 3 21 5

0.09 0.11 0.13 0.15 0.17 0.19 0.22 0.05 0.07

91 45 22 11 14 7 4 17 5

0.09 0.11 0.14 0.16 0.18 0.22 0.25 0.04 0.06

208 104 52 26 32 16 8 83 20

0.21 0.26 0.31 0.39 0.43 0.51 0.57 0.20 0.29

61 30 15 7 9 4 2 14 3

0.06 0.08 0.09 0.11 0.12 0.13 0.14 0.03 0.04

135 61 30 15 18 9 4 135 32

0.14 0.15 0.18 0.23 0.24 0.29 0.29 0.33 0.46

171 85 42 21 26 13 6 42 10

0.17 0.21 0.25 0.32 0.35 0.41 0.43 0.10 0.15

of each task Vi is defined to be the latest finish time of its immediate predecessors. Vi is first tried to be assigned to an existing VM instance of the specific type determined by Sf irst beginning at the ESTVi , otherwise, a new VM instance of the specific type determined by Sf irst is launched and Vi is assigned beginning at ESTVi . It is obvious that the forward scheduling procedure does not consider the time fraction slots produced by the hourly pricing model, which results in many wasted time fractions. Therefore, a backward scheduling procedure that considers the matchings between task execution times and the left free time slots is applied. In this backward scheduling procedure, tasks are allocated to free time slots based on a priority rule, which considers the task finish time, wasted time fractions, and added hours. Finally, tasks are shifted forward again maintaining the VM instance assignments of the previous backward scheduling to make the workflow finish as early as possible. Details of each components of the proposed BDA are described below.

above, different types of VM have different configurations and are suitable for executing different types of tasks. For example, normalized VM instances are suitable for common tasks, high-CPU VM instances for computationally-intensive tasks and high-memory VM instances for database operation tasks. Let dti denote the execution time (in minutes) of task Vi on VM instances of type Tt . The execution time and cost (dti × P rice(t)/60 ) of tasks in Figure 2 are shown in Table II. For example, task V1 is a computationlly-intensive task. It can be executed on high-CPU VM instances with shorter time and lower cost than on other types of VM instances. Task V6 is memory-intensive and can be executed on high-memory VM instances more cost-efficiently (shorter time and lower cost). Therefore, tasks must be allocated to appropriate types of VM instances, guaranteeing the cost-efficiency. In this paper, the commonly used hourly pricing model is applied, i.e., users are charged based on the actual number of hours for which the cloud resources were used. Even if a partial hour is used, the whole hour should be paid. Consequently, both the costefficiency of VM types and the time fraction slot produced by the hourly charging strategy should also be taken into account while solving the cloud resource provisioning and allocation problem.

A. Tasks to VM types assignment algorithm In this subsection, the relaxed problem is modeled as a mixed integer linear program (MILP) and solved by CPLEX to determine the VM type of each task . In the relaxed problem, cost cti of task Vi on VM type Tt is just the value of (dti + DTi ) × P rice(t)/60 without considering the hourly pricing model and differences of data transfer times when tasks are deployed on distinct VM instances. χti = 1 denotes that task Vi is assigned to VM type Tt , otherwise χti = 0. fi is the finish time of task Vi . The relaxed MILP problem can be formally described as follows. M t  (1) Min Vi ∈V t=1 ci M t S.t. (2) t=1 χi = 1, 1 ≤ i ≤ N M fi ≤ fj − t=1 dtj χtj , ∀(i, j) ∈ E (3) M (4) f0 ≥ t=1 dt0 χt0 χti ∈ {0, 1}, 1 ≤ t ≤ M (5) t + di ∈ I , 0 ≤ i ≤ N, 1 ≤ t ≤ M (6) fN ≤ D (7)

3) Definitions for workflow scheduling: In this paper, resource renting cost for executing the workflow is minimized so as to meet the workflow deadline D. Let Mm and T ype(Mm ) denote the mth used VM instance and the index of the VM type respectively. III.

P ROPOSED H EURISTIC

In this section, a Bi-Direction Adjust heuristic (BDA) is proposed for the renting cost minimization problem, including an illustrative example and complexity analysis. The proposed BDA mainly consists of two stages, the first stage decides which VM type tasks should be allocated to and the second stage allocates tasks to VM instances in detail. Since the hourly pricing model and the data transfer times make the problem more complicated to solve, these factors are initially removed (transfer times are directly added to the execution time of tasks no matter which instance they are allocated to) from the original problem at the first stage. Then, the relaxed problem is formally modeled and solved using CPLEX, getting a schedule Sf irst . At the second stage, a bi-direction adjust process, composed of the forward and backward scheduling procedures, is applied to allocate each task to appropriate VM instance. In the forward scheduling procedure, the execution time of a task is determined by the VM type assignments of Sf irst . Earliest start time ESTVi

The objective function (1) is to minimize the total cost, in which the cost of the wasted time fractions are not included. Each task is assigned to one and only one VM type according to constraint (2). Constraints (3) and (4) guarantee the precedence constraints. Constraint (5) denotes a binary decision variable. The execution times of activities are integers (in minutes) according to constraint (6). The deadline is met according to the constraint (7).

96

TABLE III. Tasks VM types

VM TYPE ASSIGNMENTS OF TASKS IN F IGURE 2 V1

V2

V3

V4

V5

V6

V7

C M

C M

C M

C EL

C M

N L

C EL

Algorithm 1 Forward scheduling 1: for t = 1 to T do 2: P ool(t) ← null./*Initialize VM pool*/ 3: end for 4: for i = 1 to N − 1 do 5: ESTVi = maxVp ∈Pi {FTVp }. 6: if all Vp ∈ Pi are assigned to the same VM instance Mp and type(Mp ) is equal with Sf irst [Vi ] and interva = S [V ] [ESTVi ,ESTVi + di f irst i ] of Mp is free then 7: Assign Vi to interva of Mp . FTVi = ESTVi + S [V ] di f irst i , goto step 5 8: end if 9: for each Mm ∈ P ool(Sf irst [Vi ]) do S [V ] 10: if intervb = [ESTVi ,ESTVi + di f irst i + T TVi ] of Mm is free then 11: Assign Vi to time interval intervb , FTVi = S [V ] ESTVi + di f irst i + T TVi , goto step 5 12: end if 13: end for 14: Launch a new VM instance Mnew of type Sf irst [Vi ]. S [V ] 15: Assign Vi to time interval [ESTVi ,ESTVi + di f irst i + T TVi ] of Mnew . S [V ] 16: FTVi = ESTVi + di f irst i + T TVi . 17: P ool(Sf irst [Vi ]) ← P ool(Sf irst [Vi ]) ∪ {Mnew } 18: end for 19: return

This relaxed problem is still NP-hard [1]. Therefore, CPLEX is used to solve the corresponding MILP. When a given maximum execution time is used or the avigap gap between the best integer objective and the objective of the best node remaining falls below a specified value, the mixed integer optimization of CPLEX is stopped. That is to say, an approximate solution is obtained. For the the workflow in Figure 2, a task to VM type schedule Sf irst is generated by CPLEX. Sf irst [Vi ] represents the VM type index of task Vi in schedule Sf irst and the details of VM type assignments of tasks in Figure 2 are shown in Table III. B. Tasks to VM instances assignment algorithm In this subsection, tasks will be allocated to VM instances based on the result Sf irst of the first stage. 1) Forward scheduling: At first, VM instance pool P ool(t) of each type Tt , 1 ≤ t ≤ M is initialized to be null. Then, task V0 to VN are scheduled one by one. For each task Vi , ESTVi is calculated in terms of the execution times determined by Sf irst . If all immediate predecessors Vp ∈ Pi of task Vi are assigned to the same VM instance Mp and T ype(Mp ) = Sf irst [Vi ], Vi is tried to be assigned to Mp first. S [V ] If the time interval interva = [ESTVi ,ESTVi + di f irst i ] on Mp is free, task Vi is assigned to interva on Mp . Otherwise, each existing VM instance Mm with T ype(Mm ) = Sf irst [Vi ] is checked whether the time interval intervb = [ESTVi S [V ] ,ESTVi + di f irst i + T TVi ] is free. Once a free time interval intervb on an existing VM instance is found, task Vi is assigned to intervb of the found VM instance. If no existing VM instance fulfills the mentioned above requirements, a new VM instance Mnew of type TSf irst [Vi ] is launched and Vi is S [V ] assigned to the time interval [ESTVi , ESTVi +di f irst i +T TVi ] on the Mnew . The details of the forward scheduling algorithm is formally described in Algorithm 1 .

 

&B0B



&B0B



&B(/B



1B/B Fig. 3.



    



WLPH

 

GHDGOLQH

The forward scheduling result for the illustrative workflow

one by one according to the same procedure previously used and a forward schedule result Sf orward is shown in Figure 3.

Look at Figure 3 as the scheduling result of the workflow in Figure 2. V1 to V7 are scheduled one by one. Since there is no existing VM instance at the beginning, a new VM instance MC M 1 of type C M is launched and V1 is assigned at time interval [0,35]. For V2 , the only immediate predecessor V1 is assigned to MC M 1 and Sf irst [V2 ] = C M , therefore, V2 is assigned to MC M 1 at the time interval [35,56] without data transfer time. Although there exists a VM instance MC M 1 of type C M , the time interval [35,71] of it is not free for V3 . Therefore, a new VM instance MC M 2 of type Sf irst [V3 ] = C M is launched and V3 is assigned to the time interval [35,77]. Considering task V4 , we find that no VM instance with type C EL exists. Therefore, a new VM instance MC EL 3 of type C EL is launched. V4 is allocated to [35,58]. Because V5 and its only immediate predecessor V4 are assigned to different VM types according to Sf irst , MC EL 3 is not considered when scheduling V5 . Although there are two existing VM instances MC M 1 and MC M 2 , the time interval [58,81] is not free on MC M 2 . So, V5 is assigned at [58,81] on MC M 1 . Then, tasks are scheduled

2) Backward scheduling: Before introducing the backward scheduling procedure, the free time slots of a VM instance, a VM type, and a schedule are defined. For each VM instance Mm of a schedule, all idle free time intervals between zero time point and the deadline are defined to be the free time slots of this VM instance labeled as Slots(Mm ). The free time slots of a specific VM type Tt in a schedule is the total free time slots of all VM instances with type Tt represented as Slots(Tt ). The free time slots of a schedule is the total free time slots of all VM types. For example in the Figure 4, Slots(C M 1)= {[56, 58], [81, 119]}, Slots(C M 2)= {[0, 35], [58, 119]}, Slots(C EL 3)= {[0, 35], [58, 119]} and Slots(N L 4)= {[0, 58], [91, 119]} are the free time slots of the VM instances MC M 1 , MC M 2 , MC EL 3 and MN L 4 respectively in the schedule Sf orward (after removing the task V7 ) . The free time slots of type C M are computed as Slots(C M )= Slots(C M 1) ∪ Slots(C M 2) and free time slots of the whole schedule are Slots(Sf orward )=Slots(C M 1) ∪ Slots(C M 2) ∪

97

>@  

&B0B >@



>@

&B(/B >@



>@   

>@

E



>@



1B/B







&B0B



WLPH 

 

/)7

WLPH

GHDGOLQH



F



G H



>@

Fig. 4.

D

 

I



An example of free time slots

J



 



Slots(C EL 3)∪Slots(N L 4). Let slot represents a single free time slot, Begin(slot) is the start time point of the slot and End(slot) is the finish time point (in minutes).

WLPH  :DVWHGWLPH



A backward adjustment procedure, which makes appropriate matches of tasks and the free time slots, is investigated to further reduce the cost and ensure the workflow deadline. In the forward scheduling procedure, a task-VM instance mapping Sf orward is obtained according to Sf irst . In order to guarantee the workflow deadline, each task is assigned considering the latest finish time of its immediate predecessors strictly, which inevitably results in many wasted time fractions (less than one hour). In the backward schedule procedure, for each task Vi , an available moving time interval [earliest start time, latest finish time] is first calculated according to the concurrent schedule. Then, Vi is adjusted to an appropriate time slot between the available moving time interval to reduce the wasted time fractions for saving renting cost.





Fig. 5.

K L

WLPH    QHZO\UHQWHGKRXUV

Priority factors considered in the backward scheduling procedure

of the time interval [Begin(slot), STVi ], otherwise it is equal to the length of the time interval[HPlef t , STVi ]. If the nearest right hourly point HPright from FTVi is less than End(slot), the ending wasted time W EVslot is i equal to the length of the time interval [FTVi , HPright ], otherwise it is equal to the length of the time interval [FTVi ,End(slot)]. For example in Figure 5 (2), LF T is the latest finish time. It is obvious that Me best matches V2 , since the wasted time is the least. The F cwaste (slot) = (WBVslot + W EVslot )/60 is a normalized value to represent i i the wasted time factor. (c) Minimize the added cost caused by the newly added tasks. If the task is assigned to already rented hours, the cost of deploying the task is equal to zero, otherwise, added cost is the total rental for any newly rented hours (no matter as to whether the hour is fully or partially used). In Figure 5(3), the cost of assigning V3 to Mh is the rental cost of the newly rented one hour of time. But, if V3 is assigned to Mi , the added cost is zero because the two used hours of V3 have already been rented. Addedhour(Vi , slot) denotes the added hours of Vi on slot . F ccost (slot) = S [V ] Addedhour(Vi , slot) ∗ 60/(di f irst i + T TVi ) is the normalized cost factor.

The details of the proposed backward scheduling procedure are as follows. Let eligible set El contain tasks, successors of which are all scheduled. STVi and FTVi are the start and finish times of task Vi in the concurrent schedule. The time point (in minutes) which is the multiple of 60 is called hourly point HP such as 60, 120, 180. At the beginning, the Sf orward is taken as the base schedule and initialized as Sbackward ← Sf orward , eligible set El ← {VN } . Then tasks of El are removed from the Sbackward and free time slots of Sbackward are calculated. The latest finish time of each task Vi ∈ El is computed as LFTVi = minVs ∈£i {STVs }. Next, tasks of El are assigned to appropriate time slots one by one in the descending order of LFT . When making a match of a task and free time slots, the following three factors should be considered: (a) Move the tasks backward as late as possible subject to the workflow deadline D (FTVi ≤ LFTVi for all 1 ≤ i ≤ N − 1). The objective of this factor is to give more time intervals for later tasks ( giving them more choices). For example in Figure 5 (1), assigning task V1 to the first VM instance will leave more available free time slots for its predecessors. The F cf t (slot) = (LFTVi −FTVi )/(LFTVi − S [V ] ESTVi − di f irst i − T TVi ) is a normalized value, which respects the finish time factor. (b) Minimize the wasted time of tasks among the selected free time slots. In order to evaluate Vi on a given free time slot slot, STVi and FTVi are recalculated, assuming Vi has been assigned to that slot. If the nearest left hourly point HPlef t from STVi is less than Begin(slot), the beginning waste time WBVslot of the task Vi on slot is equal to the length i

All these three factors are combined together to determine the assignment of tasks to free time slots. But only the free time slots on the VM instances, type of which is the same as the original VM type TSf irst [Vi ] , are possible candidates for task assignment. When scheduling a task Vi , a priority value Value(Vi , slot) for each candidate slot slot ∈ Slots(TSf irst [Vi ] ) is computed as follows. Value(Vi , slot) = F cf t ∗ a + F cwaste ∗ b + F ccost ∗ c in which a, b and c are weight factors (equal to 1 in this paper). After all tasks in El are scheduled, El is updated. If El equals null, the backward scheduling procedure terminates,

98



Algorithm 2 Backward scheduling 1: Initialize El ← {VN }, Sbackward ← Sf orward . 2: Calculate LFTVi for all Vi ∈ El. 3: Remove tasks of El from Sbackward . 4: for each Vi in El do 5: for each Mm ∈ P ool(Sf irst [Vi ]) do 6: Calculate Slot(Mm ). 7: for each slot in Slot(Mm ) do 8: Assign Vi on slot as late as possible. 9: Calculate STVi and FTVi . 10: Calculate Value(Vi , slot). 11: if Value(Vi , slot) < Valuelow then 12: Valuelow ← Value(Vi , slot) 13: Sbst ← Sbackward 14: end if 15: Remove the assignment of Vi on slot. 16: end for 17: end for 18: Sbackward ← Sbst . 19: end for 20: Label all tasks in El as scheduled and update El. 21: if El = N U LL then 22: goto step 2. 23: end if 24: return Sbackward

 

&B0B



GHDGOLQH





 

D

&B0B

F

&B(/B



E   





WLPH



1B/B

GHDGOLQH 

  

&B0B











&B0B



      



&B(/B







1B/B

GHDGOLQH 

 Fig. 6.

WLPH

An example for the backward scheduling procedure

Algorithm 3 Forward shifting 1: Initialize Sf inal ← Sbackward . 2: Sort tasks by the finish time in Sf inal in ascending order. 3: for k = 0 to N do 4: Vk ← GetT ask(Sbackward , i). 5: Shift task Vk as earlier as possible while not increasing renting cost. 6: end for 7: return Sf inal

otherwise tasks of El will be scheduled in the next iteration. The backward scheduling procedure is formally described in Algorithm 2. For the example of Figure 2, as shown in Figure 6, V7 , V6 , V5 and V4 have already been scheduled. The next step is to schedule V3 and there are two available VM instances of type C M with three candidate free time slots slota , slotb and slotc . The length of slotb is less than the execution time of V3 . Therefore, slotb is eliminated first. And the calculation of priority values on slota and slotc are as follows.











&B0B



 



GHDGOLQH

&B0B

 

&B(/B

 







1B/B

F cf t (slota ) = (107 − 84)/(107 − 35 − 17 − 6) = 0.47 F cf t (slotc ) = (107 − 107)/(107 − 35 − 17 − 6) = 0 F cwast (slota ) = 7/60 = 0.116 F cwast (slotc ) = (24 + 13)/60 = 0.616 F ccost (slota ) = 0 F ccost (slotc ) = 60/23 = 2.61 Value(V3 , slota ) = 0.47 ∗ a + 0.116 ∗ b + 0 ∗ c = 0.586 Value(V3 , slotc ) = 0 ∗ a + 0.616 ∗ b + 2.61 ∗ c = 3.226

WLPH   UHQWHGKRXUV

 

&B0B





 

GHDGOLQH

&B0B

   



&B(/B 1B/B 

As a result, V3 is assigned to slota , which has a lower priority value.

Fig. 7.

3) Forward shifting: In the backward scheduling procedure, the finish time factor causes the tasks to be assigned as late as possible. In order to improve the robustness of the schedule (tasks finish earlier), it is better to shift tasks forward again. At first, tasks are sorted by the finish time in terms of the schedule Sbackward and GetT ask(Sbackward , i) returns the ith finished task of Sbackward . Then, tasks can only be shifted forward on their assigned VM instance if they do not disturb the order of tasks on that VM instance. This means that the tasks are shifted as earlier as possible to ensure that

 



 

 

WLPH   UHQWHGKRXUV

Final scheduling result of the workflow in Figure 2

the resource renting cost does not increase. The details of this process are described in Algorithm 3 For the workflow of Figure 2, the result of the backward schedule is shown in Figure 7(1). In the forward shifting process, all tasks are shifted as early as possible except that V6 is not shifted to the earliest start time 58 but the hourly point 60. Shifting task V6 to 58 would have increased additional one rented hour. The final result of workflow in Figure 2 is shown in Figure 7(2) and the final VM renting cost is $2.39.

99

C. Complexity Analysis

Algorithm 4 Random Instance Generating Algorithm 1: Generate tasks V = {0, 2, . . . , N }; 2: while OSc ≤ OS do 3: Generate a non-existed arc (i, j), i < j randomly; 4: if (∀Vt1 ∈ Pj ∀Vt2 ∈ £i ∀Vt3 ∈ Pi ∀Vt4 ∈ £j )(path(i, j) = 0 ∧ path(t1 , i) = 0 ∧ path(j, t2 ) = 0 ∧ path(t3 , t4 ) = 0) then 5: Accept the arc (i, j), recalculate Order Strength OSc . 6: end if 7: end while 8: return

For the solution process using CPLEX, N/10 number of seconds are the time limitation and the avigap is set to be 0.1%. Now, let H (in minutes) be the maximum scheduling horizon span. In step 4 of Algorithm 1, there are N iterations and the complexity of the sub steps is O(N ). Therefore the complexity of Algorithm 1 is O(N 2 ). In Algorithm 2, El has N tasks at most in step 4, there are N number of VM instances mostly in step 5 and H free time slots for each VM instance. Therefore the complexity of Algorithm 2 is O(N 2 H). In step 3 of Algorithm 3, there are N iterations and the complexity of the sub steps is O(N ). Therefore the complexity of Algorithm 3 is O(N 2 ). Thus, the computational complexity of the proposed BDA heuristic is O(N 2 H). IV.

added to the network one by one where an arc is accepted only if it does not produce any redundancy [14].

COMPUTATIONAL RESULTS

Using the above test problem generation scheme, for each combination of N and OS, 100 problem instances are generated. Thus, a total of 1800 problem instances ( = 6(N ) *3(OS)*100) are generated and used in our computational experiments.

We now describe the computational tests used to evaluate the effectiveness of the proposed BDA heuristic in finding good quality workflow schedules. To do this, the proposed BDA heuristic is compared with the existing state-of-the-art heuristic ICPCP [9]. For solving the problem of matching tasks and VM types, the ILOG CPLEX v12.4 with default settings is used to solve the constructed MILP model of the workflow problem formulated in Section III earlier. The two algorithms (BDA, ICPCP) were coded in Java. Computational experiments for the two algorithms and ILOG CPLEX v12.4 were performed on Core 2 computer with one 3.1GHZ processor, 1G RAM, and Windows XP operating system.

B. Comparison with Existing Algorithms To compare the effectiveness of the proposed BDA algorithm with existing algorithms, several measures are used. Let Cb∗ be the total cost if all tasks of a problem instance b select the cheapest service. For the convenience of reporting, let Wp be the total number of all problem instances for parameter combination p which are grouped together. Further, let Cb (A) be the total cost of instance b obtained by algorithm A. Then, the ANC (averagenormalized resource renting cost) is Wp computed as AN C = ( b=1 Cb (A)/Cb∗ )/Wp .

A. Test Problems Since parameters exert influence on the performance of an algorithm, they should be tested on different values. Existing test problem instances used by Abrishami et al. [9] only have paths with at most 9 tasks. However, in practice, paths of workflow have much more tasks. In our computational experiments, therefore, parameters of the problem instances are as follows: •

the number of tasks, N in a workflow takes a value from {100, 200, 300, 500, 700, 900};



the number of VM types , M = 9 types of VM instances shown in Table I are considered in this paper;



the complexity of the network structure, measured by OS according to [13], takes a value from {0.1, 0.2, 0.3};



deadlines are generated by D = Dmin + (Dmax − Dmin ) ∗ θ where Dmin is the minimal total duration (using shortest execution time of each task), Dmax is the maximal total duration of the workflow, and θ is the Deadline Factor, which takes a value from {0.15, 0.3, 0.45, 0.6}. This ensures the existence of at least one feasible solution.

Figure 8, 9, 10 and 11 are the experimental results when DF=0.15, 0.3, 0.45 and 0.6 respectively. These four figures illustrate that BDA outperforms ICPCP on average normalized resource renting cost (ANC) for all cases. Maximally, 80% percentage of VM renting cost is saved. As N increases, ANC of BDA remains relatively stable while that of ICPCP increases, which demonstrates that the scale of the worlflow has no significant impact on the performance of the BDA. Further, as OS increases, ANC of ICPCP increases for most cases but OS has no great impact on the performance of BDA which implies that BDA is more robust than the compared algorithm. ANC tends to decrease as DF increases, which means that looser deadline makes the considered problem easier to solve. Finally, both the BDA and ICPCP heuristics are very fast and the actual computation times are less than 60s for workflows with 900 tasks. V.

C ONCLUSIONS

In this paper, workflow application tasks of real-time analytics or online advertising industries are allocated to VM instances. Some practical factors such as hourly charging model and data transfer time are considered to minimize the resource renting cost. A bi-direction adjust heuristic (BDA) which consists of forward and backward scheduling procedures is proposed. In the proposed BDA, a priority rule, which considered the three factors: finish times, wasted time fractions and added renting hours, is investigated to make appropriate matches of tasks and free time slots. BDA is compared with the

The paths connecting various tasks are randomly generated, during which the redundant arc avoiding method given by [14] is adopted. The details are shown in Algorithm 4. path(i, j) = 0 means that there is no path from Vi to Vj . Step 1 of Algorithm 4 generates N + 1 number of tasks with ascending integer numbers. Then, in step 2, random arcs are

100

BDA

8

ICPCP

enhance the results of the backward scheduling procedure.

Normalized Cost

7

6

R EFERENCES

5

4

[1]

3 2 1

[2]

0 0.1

0.2

0.3

0.1

102

0.2

0.3

0.1

202

0.2

0.3

0.1

302

0.2

0.3

0.1

502

0.2

0.3

0.1

702

0.2

0.3

902

[3]

Task Number and Order Strength

Fig. 8.

Average normalized cost when the deadline factor equals 0.15 [4] BDA

7

ICPCP

Normalized Cost

6

5

[5]

4 3 2

[6]

1

0 0.1

0.2

0.3

0.1

102

0.2

0.3

0.1

202

0.2

0.3

0.1

302

0.2

0.3

0.1

502

0.2

0.3

0.1

702

0.2

0.3

[7]

902

Task Number and Order Strength

Fig. 9.

[8]

Average normalized cost when the deadline factor equals 0.30 BDA

7

ICPCP

Normalized Cost

6

[9]

5 4 3

[10]

2 1

0 0.1

0.2

0.3

0.1

102

0.2

0.3

0.1

202

0.2

0.3

0.1

302

0.2

0.3

0.1

502

0.2

0.3

0.1

702

0.2

[11]

0.3

902

Task Number and Order Strength

Fig. 10.

[12]

Average normalized cost when the deadline factor equals 0.45 BDA

6

ICPCP

[13]

Normalized Cost

5 4

[14]

3 2 1

0 0.1

0.2 102

0.3

0.1

0.2 202

0.3

0.1

0.2 302

0.3

0.1

0.2

0.3

0.1

502

0.2 702

0.3

0.1

0.2

0.3

902

Task Number and Order Strength

Fig. 11.

Average normalized cost when the deadline factor equals 0.60

state-of-the-art heuristic ICPCP for the considered problem. Experimental results show that the proposed BDA heuristic outperforms the ICPCP for all cases. In some cases, the VM renting cost using the proposed BDA reduced by as much as 80% when compared to the rental cost using the ICPCP. As the number of VM types and the number of tasks increase, the matching of task and VM type becomes much harder to solve using CPLEX. Therefore, effective and efficient heuristics should be developed for it. Further, a more effective forward shifting heuristic should be developed and tested to

101

P. De, E. Dunne, J. Ghosh, and C. Wells, “Complexity of the discrete time-cost tradeoff problem for project networks,” Operations research, vol. 45, no. 2, pp. 302–306, 1997. Y.-K. Kwok and I. Ahmad, “Static scheduling algorithms for allocating directed task graphs to multiprocessors,” ACM Computing Surveys (CSUR), vol. 31, no. 4, pp. 406–471, 1999. R. Bajaj and D. P. Agrawal, “Improving scheduling of tasks in a heterogeneous environment,” Parallel and Distributed Systems, IEEE Transactions on, vol. 15, no. 2, pp. 107–118, 2004. E.-K. Byun, Y.-S. Kee, J.-S. Kim, E. Deelman, and S. Maeng, “Bts: Resource capacity estimate for time-targeted science workflows,” Journal of Parallel and Distributed Computing, vol. 71, no. 6, pp. 848–862, 2011. J. Yu, R. Buyya, and C. Tham, “Cost-based scheduling of scientific workflow applications on utility grids,” in e-Science and Grid Computing, 2005. First International Conference on. IEEE, 2005, pp. 8–pp. Y. Yuan, X. Li, Q. Wang, and X. Zhu, “Deadline division-based heuristic for cost optimization in workflow scheduling,” Information Sciences, vol. 179, no. 15, pp. 2562–2575, 2009. S. Abrishami, M. Naghibzadeh, and D. Epema, “Cost-driven scheduling of grid workflows using partial critical paths,” Parallel and Distributed Systems, IEEE Transactions on, vol. 23, no. 8, pp. 1400–1414, 2012. M. Mao and M. Humphrey, “Auto-scaling to minimize cost and meet application deadlines in cloud workflows,” in High Performance Computing, Networking, Storage and Analysis (SC), 2011 International Conference for. IEEE, 2011, pp. 1–12. S. Abrishami, M. Naghibzadeh, and D. Epema, “Deadline-constrained workflow scheduling algorithms for iaas clouds,” Future Generation Computer Systems, 2012. J. Yu and R. Buyya, “Scheduling scientific workflow applications with deadline and budget constraints using genetic algorithms,” Scientific Programming, vol. 14, no. 3, pp. 217–230, 2006. W. Chen and J. Zhang, “An ant colony optimization approach to a grid workflow scheduling problem with various qos requirements,” Systems, Man, and Cybernetics, Part C: Applications and Reviews, IEEE Transactions on, vol. 39, no. 1, pp. 29–43, 2009. Z. Wu, X. Liu, Z. Ni, D. Yuan, and Y. Yang, “A market-oriented hierarchical scheduling strategy in cloud workflow systems,” The Journal of Supercomputing, vol. 63, no. 1, pp. 256–293, 2013. E. Demeulemeester, M. Vanhoucke, and W. Herroelen, “Rangen: A random network generator for activity-on-the-node networks,” Journal of Scheduling, vol. 6, no. 1, pp. 17–38, 2003. R. Kolisch, A. Sprecher, and A. Drexl, “Characterization and generation of a general class of resource-constrained project scheduling problems,” Management science, vol. 41, no. 10, pp. 1693–1703, 1995.

Suggest Documents