This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/TSC.2016.2518187, IEEE Transactions on Services Computing 1
Cloud workflow scheduling with deadlines and time slot availability ´ Ruiz Xiaoping Li, Senior Member, IEEE, Lihua Qian, and Ruben Abstract—Allocating service capacities in cloud computing is based on the assumption that they are unlimited and can be used at any time. However, available service capacities change with workload and cannot satisfy users’ requests at any time from the cloud provider’s perspective because cloud services can be shared by multiple tasks. Cloud service providers provide available time slots for new user’s requests based on available capacities. In this paper, we consider workflow scheduling with deadline and time slot availability in cloud computing. An iterated heuristic framework is presented for the problem under study which mainly consists of initial solution construction, improvement, and perturbation. Three initial solution construction strategies, two greedy- and fair-based improvement strategies and a perturbation strategy are proposed. Different strategies in the three phases result in several heuristics. Experimental results show that different initial solution and improvement strategies have different effects on solution qualities. Index Terms—Workflow, Scheduling, Time slots, Cloud computing.
F
1
I NTRODUCTION
Nowadays much attention has been paid on workflow scheduling in service computing environments (cloud computing, grid computing, Web services, etc). Resources are generally provided in the form of services, especially in cloud computing. There are two common ways for service delivery: (i) An entire application as a service, which can be directly used with no change. (ii) Basic services are combined to build complex applications, e.g., Xignite and StrikeIron offer Web services hosted on a cloud on a pay-per-use basis [1]. Among a large number of services in cloud computing, there are many services which have same functions and supplied by different cloud service providers (CSPs). However, these services have different non-functional properties. Basic services are rented by users for their complex applications with various resource requirements which are usually modeled as workflows. Better services imply higher costs. Services are consumed based on Service-Level Agreements, which define parameters of Quality of Service in terms of the pay-per-use policy. Though there are many parameters or constraints involved in practical workflow scheduling settings, deadline and time slot are two crucial ones in cloud computing, a new marketoriented business model, which offers high quality and low cost information services [2]. However, the two constraints have been considered separately in existing researches. It is • Xiaoping Li and Lihua Qian work at the School of Computer Science and Engineering, Southeast University, Nanjing, China, 211189; and also at the Key Laboratory of Computer Network and Information Integration, Southeast University, Ministry of Education, 211189, Nanjing, China. Tel: 86-25-52090916; Fax: 86-25- 52090916. E-mail:
[email protected] • Rub´en Ruiz works at the Grupo de Sistemas de Optimizaci´on Aplicada, Instituto Tecnol´ogico de Inform´atica, Ciudad Polit´ecnica de la Innovaci´on, Edifico 8G, Acc. B. Universitat Polit`ecnica de Val`encia, Camino de Vera s/n, 46021, Val`encia, Spain. E-mail:
[email protected]
necessary to consider both of the constraints jointly because: (i) Deadlines of the workflow applications needs to be met. (ii) Unreserved time slots is crucial for resource utilization from the perspective of service providers. (iii) Utilization of time slots in reserved intervals should be improved to avoid renting new resources (saving money). In this paper, we consider the workflow scheduling problem with deadlines and time slot availability (WSDT for short) in cloud computing. To the best of our knowledge, the considered problem has not been studied yet. Service capacities are usually regarded to be unlimited in cloud computing, which can be used at any time. However, from the CSP’s perspective, service capacities are not unlimited. Available service capacities change with workloads, i.e, they cannot satisfy user’s requests at any time when a cloud service is shared by multiple tasks. Only some available time slots are provided for new coming users by CSPs in terms of their remaining capacities. For example, each activity in Figure 1 has different candidate services with various execution times, costs and available time slots. For activity 4, there are two candidate services with different workloads. If service 0 is selected for activity 4, the execution S time is 4 with the price 6 and available time slots [0,4) [9,14). Time slot [4,9) is unavailable because there is no remaining capacity. The considered WSDT problem is similar to the the Discrete Time/Cost Trade-off Problem (DTCTP) [3] to some extent. We can modify existing algorithms for the latter to the problem under study with less than 200 activities and no more than 20 candidate services in the service pool, spending thousands of seconds. However, the number of activities is usually far more than 200 in practical workflow applications which makes the modified versions are not suitable for the problem under study. Generally, longer execution time implies cheaper cost in cloud computing for the DTCTP. However, this is not true for the WSDT. In other words, the fastest schedule of the WSDT does not mean the highest total cost in a pricing model where
1939-1374 (c) 2015 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/TSC.2016.2518187, IEEE Transactions on Services Computing 2
2
cost
4 24
1
Finish Time=12 COST = 21
20
6
V5: X500=1 V4:X411=1
16
3
5 12
Activity(execution,cost,{slot}) slot = (starttime , endtime) workload
V3: X310=1
8 4
V2: X200=1
time
capacity 2
(4,6,{(0,4),(9,14)...})
4
6
8
10
12
14
16
(a) The fastest schedule
cost
2 4 6 8 10 12 14 16 18 20 time activity
V5:X510=1
24
Finish Time=13 COST = 27
Service 0 V4:X401=1
20
4
capacity
16 V3: X300=1
12
(5,2,{(0,5),(7,14),...})
8
2 4 6 8 10 12 14 16 18 20 time Service 1
4
V2 X200=1
time
Fig. 1. A workflow example with time slots constraints 2
the cost is in the inverse proportion to the execution time. For the example depicted in Figure 1 and Table 1, Figure 2 shows the fastest schedule and a non-fastest one where xijk =1 means the k th available time slot of Mij is selected for vi (Mij is the j th available service list of vi ). In the fastest schedule π1 ={x100 =1, x200 =1, x310 =1, x411 =1, x510 =1, x600 =1}, each activity vi chooses the service to finish as early as possible. The finish time is f6 =12 and the total cost is 21. The non-fastest schedule is π2 ={x100 =1, x200 =1, x300 =1, x401 =1, x510 =1, x600 =1} with the finish time f6 =13 and the total cost 27. Figure 2 shows that the total cost of the fastest schedule is less than that of the non-fastest one. Therefore, existing methods for the DTCTP cannot be directly adapted to the WSDT. It is necessary to propose new algorithms for the problem under study. TABLE 1 Activity-Service Pool for the example Activities v1 v2 v3 v4 v5 v6
Services (Time,Cost,{Time Slot List}) (0,0,{[0,+∞)}) (3,8,{[1,6),[8,10)}),(4,5,{[4,8),[9,12)}) (3,9,{[2,6),[10,13)}),(4,7,{[0,5),[7,12)}) (4,6,{[0,4),[9,14)}),(5,2,{[0,5),[7,14)}) (5,6,{[2,9),[12,15)}),(7,4,{[3,16),[20,28)}) (0,0,{[0,+∞)})
The main contributions of this paper are summarized below: • Using mixed integer programming, we mathematically
4
6
8
10
12
14
16
(b) A non-fastest schedule
Fig. 2. A fastest schedule against a non-fastest one
•
•
model the cloud workflow scheduling problem with deadlines and time slot availability to minimize total costs from the CSPs perspective. An iterated heuristic framework is presented for the problem under study which includes three phases: initial solution construction, improvement, and perturbation. Concerning for the different characteristics of the considered WSDT problem from the classical DTCTP, effective and efficient rules for the three phases are presented, based on which several heuristics are constructed.
The rest of the paper is organized as follows. The state of the art is reviewed in Section 2. Section 3 describes the WSDT problem and preparations in detail. Section 4 presents the proposed heuristic framework and developed heuristics. Experimental results are given in Section 5, followed by conclusions and future researches in Section 6.
2
R ELATED
WORK
Cloud computing is a new market-oriented business model which provides elastic computing and storage resource on demand. Though this kind of computing paradigm becomes increasingly important for computation-intensive tasks in big
1939-1374 (c) 2015 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/TSC.2016.2518187, IEEE Transactions on Services Computing 3
data [4]–[7], much attention has been paid on scientific workflows. Deadline constrained workflow scheduling is one of the most popular scheduling problems in cloud computing [8]– [11]. Appropriate services are selected for all the activities in the involved workflow to maximize objectives. Minimizing time delay, costs and time-cost trade-off are common objectives. Service selection for workflow scheduling considering both time and cost was modeled as the Discrete Time/Cost Trade-off Problem (DTCTP) [3]. Each workflow or project activity can be fulfilled by more than one service, which consists of a service pool. Generally, workflows are represented by Direct Acyclic Graphes (DAGs). Deadlines (or budget limitations) are usual constraints for workflow scheduling. The DTCTP with deadline or budget limitation constraints was called DTCTP-D [12]. The DTCTP-D is harder than the DTCTP and the DTCTP was proven to be NP-hard [13]. It follows that the DTCTP-D is NP-hard as well. Many exact, heuristic and meta-heuristic algorithms have been developed for the DTCTP-D during the past decades. Exact algorithms, such as dynamic programming [14], the branch and bound [3], benders decomposition [12], were proposed. However, exact algorithms are usually heavily timeconsuming for complex workflow instances when the number of activities is more than 200. Based on deadline division, several heuristics were developed for the DTCTP-D in distributed computing environments. Yu et al. [15] proposed the Deadline Markov Decision Process (DMDP) method for utility workflow scheduling. DMDP partitioned the DAG into subgraphs and assigned each partition a sub-deadline according to the minimum execution time of activities and the whole workflow deadline. Yuan et al. [16] presented the Deadline Early Tree (DET) method where a single critical path was constructed to distinguish critical and non-critical activities. Critical activities were scheduled first and the non-critical ones were scheduled according to their priorities. The priorities were determined by floats or slacks (the amount of time that a task could be delayed without causing a delay of both subsequent tasks and the project due date). Abrishami et al. [17] proposed the Partial Critical Paths (PCP) method. All activities were partitioned into different partial critical paths. Each partial critical path was scheduled according to priorities of its activities. They demonstrated that PCP outperforms DMDP and DET. Liu et al. [18] proposed the Path Balanced based Cost Optimization (PBCO) algorithm which adjusted the length of each path in a workflow. A deadline was set for each task. The remaining time was distributed proportionally to tasks according to the number of tasks at each level (the depth of a path node from the source or sink node [15], [16]) using the bottom level strategy. PBCO demonstrated better performance than DET and DBL. Though it seems that there is no existing work on the DTCTP-D, a few metaheuristics were proposed for workflow scheduling in Grid computing ( [19], [20]) or only for the DTCTP [21]. Most existing methods for workflow scheduling in cloud computing consider only task constraints (e.g., deadlines) from the perspective of users. Services are rented with an interval-based pricing model. Rented intervals are exclusively
reserved and owned by users, i.e., cloud resources (services) are assumed to be unlimited during these intervals. Cai et al. [22] presented service scheduling with start time constraints in distributed collaborative manufacturing systems. They modeled this problem as a Discrete Time-Cost Tradeoff Problem with Start Time Constraints (DTCTP-STC) and proved it to be NP-hard. A dynamic programming algorithm was presented for small instances. Cai et al. [23] considered the traditional service selection problem with time/cost tradeoff under the workflow deadline constraint. Based on the proposed Critical Path based Iterative heuristic (CPI) in [23], they considered shareable service provisioning for workflows in public clouds in [24]. The List-based Heuristic considering Cost minimization and Match degree maximization heuristic (LHCM) was proposed for maximizing utilization, which was based on several priority rules for assigning tasks to rented services. LHCM guided users to choose proper type and number of shareable services for batch or Message Passing Interface (MPI) tasks. A special type of shareable service provisioning problem was considered in [25], where one task could be executed on only one Virtual Machine (VM) instance. Reserved intervals resulted in time slots for the cloud services from the perspective of resource providers. In addition, there would be some time slots in reserved intervals because the required amount of resources is less than that of the rented resources.
3
P ROBLEM
FORMULATION AND PREPARA -
TION
The WSDT and the DTCTP have different available time slots. In the DTCTP, each service can be used at any time, namely the available time slot for each service is [0,+∞). To illustrate the different time slots between the WSDT and the DTCTP, a set of candidate services for the activities in Figure 1 are shown in Table 1. v1 and v6 are dummy activities. Both of them have only one candidate service with the execution time 0, the cost 0, and the available time slot [0,+∞). Activity v2 has two available services M20 and M21 . The execution time and cost of M20 are 3 and 8 and those of M21 are 4 and 5. The available time slot of each candidate service of v2 is [0,+∞) in the DTCTP while available time slot lists of M20 and M21 are {[1,6),[8,10)} and {[4,8),[9,12)} respectively in the WSDT. Within the same deadline (e.g., 12), optimal schedules with total cost minimization for the DTCTP and the WSDT are different, as depicted in Figure 3. The optimal schedule’s cost of the WSDT is greater than that of the DTCTP because of different available time slots. In addition, the DTCTP can be seen as a special case of the WSDT when the available time slot is [0,+∞) for each service. The DTCTP was proven to be NP-hard [13]. It is natural that the WSDT is NP-hard. A workflow application can be represented by a directed acyclic graph G(V,E). V ={v1 ,v2 ,...,vn } is the set of activities and E={(vi ,vj )|vi ,vj ∈V } is the set of arcs (precedences between activities). v1 and vn are two dummy activities. Each arc (vi ,vj )∈E (i6=j) indicates that vj cannot start until N c −1 vi finishes. The service pool Mi ={Mi0 ,Mi1 ,...,Mi i } of vi ∈V is composed of Nic candidate services. The services are
1939-1374 (c) 2015 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See http://www.ieee.org/publications_standards/publications/rights/index.html for more information.
This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/TSC.2016.2518187, IEEE Transactions on Services Computing 4
20
cost
as follows. COST=18 V5: X51=1 V4:X41=1
16 12
8
c
Deadline
min
V3: X31=1
time 4
6
8
10
12
14
16
(a) DTCTP
xijk =1, vi ∈V
(2)
(Bijk +eij )·xijk ≤fi , vi ∈V
(3)
j=1 k=1 c
Ns
Ni ij X X j=1 k=1
c
COST=21
20
Ns
Ni ij X X fi ≤ (Fijk ·xijk ), vi ∈V
V5:X510=1
Deadline 16
V4:X411=1
(4)
j=1 k=1 c
Ns
Ni ij X X fi −fp ≥ (eij ·xijk ), (vp ,vi )∈E
V3: X310 =1
(5)
j=1 k=1
8 4
Ns
Ni ij X X
cost
12
(1)
s.t.
V2: X21=1 2
cij xijk
vi ∈V j=1 k=1
c
4
Ns
Ni ij XX X
fi ≤D, i∈V xijk ∈{0,1}, vi ∈V, 0≤jC(π)) then πbest ←π, C(πbest )←C(π); Perturbation(π); return πbest .
For the last three components, we present three initial solution construction strategies, two improvement methods and one perturbation strategy.
7 8 9
10 11 12 13 14
15
begin for (each vi ∈V ) do Calculate Est (i), Ef t (i), Lf t (i), Lst (i) using equations (8), (9), (10), (11); if (Ef t (n)>D) then return NULL; /* infeasible problem */ for (each vi ∈V ) do for (each service Mij ∈Mi ) do for k = 0 to Nijs −1 do if Fijk −Bi,j,k D or Bijk >Lf t (i) or Fijk 0) do 5 for each i∈U do ∗ 6 Calculate Wi according to Equation (13); ∗ 7 Record the service Mij corresponding to Wi ; 8 M ←M ∪{Mij };
13 14 15
16 17
18 19 20 21 22
successor of v[1] with the biggest Minimum Average Cost */ j∗ Select the available service M[1] corresponding to v[1] from M ; j∗ π←π∪{(v[1] ,M[1] )}; U ←U/arg(v[1] ), S←S∪{arg(v[1] )}; ∗ k←argvj =s (W[j] ); /* k the position of s in LU . */ if (k≥|U |/2) then j0 Select the available service M[k] corresponding to the activity s from M ; j0 π←π∪{(s, M[k] )}; U ←U/arg(v[k] ), S←S∪{arg(v[k] )}; for each i∈U do Update Ef t (i), Est (i), Lf t (i), and Lst (i); return π.
4.2.2 Maximum Cost Ascending Ratio First (MCARF) Let Mij and Mik be the cheapest and the second cheapest available services for vi , Tmin is the total cost of all activities selecting the cheapest services without considering availability of time slots. Mik might not exist (i.e., cik =∞), for which a binary variable is defined as ( 1 if Mik exists or cik 0) do 5 for i=0 to |U |−1 do 6 Calculate RiI of activity vi according to Equation (14); 7 Record the service Mij corresponding to RiI ; 8 M ←M ∪{(i,Mij )}; 9 10
11 12 13 14
k←argmaxi∈U {RiI }; 0 π←π∪{(k,Mkj )}; 0 /* The element (k,Mkj )∈M */ U ←U/{k}, S←S∪{k}; for each i∈U do Update Ef t (i), Est (i) and Lf t (i), Lst (i);
these ideas. Both of them are backwards adjusting heuristics, i.e., they search adjustable activities from the last activity (sink node) to the first activity (source node) in a topological order. 4.3.1 Greedy Improvement Heuristic (GIH) After an adjustable activity vi is found, we compute the Cost j D Decreasing Ratio Rijj 0 between Mi and each cheaper service 0 Mij by D Rijj 0 =(cij −cij 0 )/(eij 0 −eij ) ∗
D The available service Mij with the maximum Rijj ∗ in j D [est (i), lf t (i)] is selected to substitute Mi , i.e., Rijj ∗= D max{Rijj 0 }. Algorithm 5 gives the detailed description. Let the degree of activity vi be di . All successors and predecessors of the n activities are visited just once when calculating the latest Pn finish times and the earliest start times, i.e., there are Therefore, the time complexi=1 di activities being visited. Pn ity of Algorithm 5 is O( i=1 di ).
Algorithm 5: Greedy Improvement Heuristic (GIH) Input: Initial solution π, the earliest start time of each activity vi according to π, est={est (i)|i=1,...,n}. 1 begin 2 lf t (n)←D, lst (n)←D, cost←0; 3 for i=n−1 to 1 do 4 Calculate thenlatest o finish time of vi by lf t (i)← min lst (q) ; q∈Qi
5
Calculate the nearliest start o time of vi by est (i)← max ef t (pi ) ; pi ∈Pi
return π. 6
7
4.2.3 Earliest finish time first (EFTF) The Earliest finish time first (EFTF) rule constructs initial solutions according to priorities of activities. A smaller Ef t (i) means a higher priority for vi to be assigned a service, i.e., choosing the service time slot with the earliest finish time can make activity vi finish as early as possible. Obviously, if the scheduling problem is solvable, π must be feasible.
(15)
8 9 10
D Compute Rijj 0 for all candidate available services in [est (i),lf t (i)] using Equation (15); ∗ D Select the available service Mij with Rijj ∗= D max{Rijj 0 } to replace the current service Mij ; ∗ Update the element (i,Mij ) of π with (i,Mij ); ∗ Update lst (i) according to Mij ;
return π.
4.3.2 Fair Improvement Heuristic (FIH) 4.3 Improvement strategies Let est (i), lst (i) and lf t (i) be the earliest start time, the latest start time, and the latest finish time of activity vi respectively in the current solution π. Mij is the service assigned to vi in π. There are some adjustable activities (non-critical activities) in π, i.e., the earliest start time and the latest start time of each activity are not the same when there are at least two available services for each adjustable activity. In other words, vi is adjustable if and only if est (i)