You are on page 1of 10

2014 IEEE 22nd International Symposium of Quality of Service (IWQoS)

Online Resource Scheduling under


Concave Pricing for Cloud Computing
Rui Zhang Kui Wu Jianping Wang
City University of Hong Kong University of Victoria City University of Hong Kong
Hong Kong Canada Hong Kong
zhangrui.ray@gmail.com wkui@uvic.ca jianwang@cityu.edu.hk

AbstractWith the booming growth of cloud computing indus- is presently only ideological due to the high complexity in
try, computational resources are readily and elastically available monitoring and auditing resource usage, such as network
to the customers. In order to attract customers with various bandwidth, virtual CPU time, memory space, and so on.
demands, most Infrastructure-as-a-service (IaaS) cloud service
providers offer several pricing strategies such as pay as you go, Consequently, real-world charging schemes in IaaS cloud
pay less per unit when you use more (so called volume discount), have become absurdly complicated [13]. For instance, cloud
and pay even less when you reserve. The diverse pricing schemes providers usually adopt an hourly billing scheme, even if the
among different IaaS service providers or even in the same customers do not actually utilize the allocated resources in the
provider form a complex economic landscape that nurtures the whole billing horizon [17]. In the current cloud market, many
market of cloud brokers. By strategically scheduling multiple
customers resource requests, a cloud broker can fully take cloud providers offer big discount for reserved and long-term
advantage of the discounts offered by cloud service providers. requests [2] [1] [6]. In addition, cloud providers usually give
In this paper, we focus on how a broker may help a group of volume discount to customers with requests of large quantity,
customers to fully utilize the volume discount pricing strategy e.g., Amazon EC2 cloud [2] gives 10% discount for customers
offered by cloud service providers through cost-efficient online spending $25, 000 or above on reserved instances and 20%
resource scheduling. We present a randomized online stack-
centric scheduling algorithm (ROSA) and theoretically prove the discount for customers spending $200, 000 or above. The
lower bound of its competitive ratio. Our simulation shows that diverse pricing schemes and various discount offers among
ROSA achieves a competitive ratio close to the theoretical lower different IaaS service providers or even within the same
bound under a special case cost function. Trace driven simulation provider form a complex economic landscape way beyond
using Google cluster data demonstrates that ROSA is superior the control of individual end users. This leaves opportunities
to the conventional online scheduling algorithms in terms of cost
saving. for the cloud brokers to emerge as mediators between the
customers and the providers.
I. I NTRODUCTION Following the above trend, dedicated cloud brokers are
In the past few years, we have witnessed the tremendous emerging to help customers make better purchase decisions.
development of cloud computing, with more and more cloud Recent work shows that cloud brokers who mediate the trading
service providers jumping on the cloud bandwagon. Along process between the customers and the cloud providers can
with the stable growth of large scale public cloud providers significantly reduce the cost for the customers while helping
like Amazon EC2 [2], Windows Azure [7] and Rackspace the cloud providers to reshape or smooth out the burst in the
[8], small scale cloud providers such as ReadySpace [9] and incoming VM requests [17]. Recent market study expects that
GoGrid [4] have vigorously emerged. Despite the hype about the global cloud services brokerage market will be worth $10.5
cloud computing, however, the actual adoption rate of cloud billion US dollars by 2018 [3].
computing is still behind expectation [12], especially outside A cloud broker can help reduce the cost of customers
the United States. Clearly, to the entire cloud industry, it is through temporal multiplexing and spatial multiplexing of
crucial to stimulate end users participation in cloud comput- resources. By temporal multiplexing, the broker takes advan-
ing. From an individual cloud service providers perspective, tage of providers hourly billing cycles to use a customers
it is important to keep its competitiveness among peer cloud unused resource for executing other customers tasks [16]
service providers. As analysed in [18], the only way to cloud [15] [17]. The goal is to maximize resource utilization so
computing success is to develop adequate pricing techniques. that more customers can be accommodated and in return
In an Infrastructure-as-a-Service (IaaS) cloud, the cloud each can pay less. By spatial multiplexing, the broker takes
provider dynamically segments the physical machines, using advantage of volume discount by packing multiple customers
virtualization technologies, to accommodate various virtual resource requests to meet the providers high threshold for bulk
machine (VM) requests from its customers. In principle, the resource purchase, thus, the total cost can be reduced and each
customers only need to pay for the resource they actually can pay less consequently. While the advantages of temporal
consumed. Nevertheless, the pay-as-you-use pricing model multiplexing have been thoroughly investigated before [17],
978-1-4799-0913-1/14/$31.00 2014 IEEE the benefit of spatial multiplexing remains less explored.

978-1-4799-4852-9/14/$31.00 2014 IEEE 51


2014 IEEE 22nd International Symposium of Quality of Service (IWQoS)

Job1 4 4

Resource

Resource
Job2
Job2 3 3
Job2
2 2
Job3 Job1 Job1
1 Job3 1 Job3
Job2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
Time Time Time
(a) (b) (c)
Fig. 1: An example shows that a conventional scheduler gives a cost suboptimal schedule.

When being offered with volume discount from a cloud randomized online stack-centric scheduling algorithm
service provider, end customers may be willing to adjust (ROSA), under a generic concave cost function. We the-
the execution speed of their jobs, especially those time- oretically prove the lower bound of its competitive ratio
flexible and interruption-tolerant tasks, so that a higher volume and evaluate its performance with trace-driven simulation
discount can be enjoyed due to the higher amount of total using Google cluster data. Experimental results show that
requested resource of the jobs from a group of customers. ROSA achieves a competitive ratio close to the theoretical
We use an example to illustrate that conventional scheduling lower bound under the special case cost function and is
may not lead to the optimal cost under volume discount. As superior to the conventional online scheduling algorithm
shown in Fig. 1 (a), we have three incoming jobs. Job 1 in terms of cost saving.
arrives at time 0 with a deadline of 5, a workload (which The rest of the paper is organized as follows. In Section II,
is measured by the amount of requested resource) of 6 and we formulate the resource scheduling problem. In Section III,
a maximum processing speed1 of 3. Job 2 arrives at time we first analyse the properties that an optimal schedule should
3 with a deadline of 7, a workload of 3 and a maximum possess. We then study a special type of cost functions and
processing speed of 1. Job 3 arrives at time 6 with a deadline develop an optimal offline algorithm under such a special
of 9, a workload of 6 and a maximum processing speed of type of cost functions. In Section IV, we propose and study
2. Suppose that the threshold for volume discount is 2, a a randomized online algorithm, ROSA, which achieves low
conventional scheduler may schedule a job with its maximum competitive ratio with a linear complexity. Section V presents
processing speed starting from the instant when the job is our experimental results using Google cluster data. Section VI
submitted, as shown in Fig. 1 (b). Under this schedule, no concludes the paper.
volume discount can be enjoyed during the execution time
II. P ROBLEM F ORMULATION
period of job 2. We can observe that postponing the starting
time for processing job 1 to 3 and dividing the execution of We consider the resource scheduling problem for IaaS
job 2 into two segments give better opportunity in enjoying clouds, where the tasks of customers may arrive at random
volume discount, as shown in Fig. 1 (c). instants with random workload that should be fulfilled before
Though different cloud service providers may offer different a given deadline. Assume that n tasks are submitted during the
pricing strategies with volume discount, a pricing strategy time interval [0, T ], indexed by J1 , J2 , . . . , Jn based on their
with volume discount can be modelled as a concave function arrival order. Associated with each task Ji , let tai , tdi , wi denote
in general, i.e., the total cost of two separate purchases for its arrival time, deadline, and the workload, respectively.
resource amounts r1 and r2 , respectively, should be no less [tai , tdi ] is denoted as the interval of task i. In practice, we
than the cost of a single purchase of the same total resource normally set the upper limit on the resource that could be
amount r1 + r2 . allocated to task Ji at any time instant, denoted by ui where
To discover cost efficient online scheduling algorithm under ui wi . We introduce ui to reflect the case that a task
a concave cost function, we make the following contributions may not be fully executed instantly even if sufficient resource
in this paper: is allocated due to the limited parallelism among processes
and/or threads of the task. Therefore, a task Ji can be denoted
Under a generic concave cost function, we investigate
by a tuple < tai , tdi , wi , ui >.
the basic features that a cost optimal scheduling should
We assume that the cloud provider has abundant computing
possess.
capacity, which is higher than the largest possible total work-
We propose an offline scheduling algorithm under a
load at any instant t. Let I(t) denote the set of tasks remaining
special case cost function and theoretically prove its
in the system at time t. The broker can schedule the computing
offline global optimality.
resource allocated to each task Ji I(t), denoted by ri (t).
We propose an online request reshaping algorithm, called
Naturally, ri (t) = 0 indicates that no resource is assigned to Ji
1 We assume that the processing speed of a job equals its instantaneous at time t. If Ji has already been partially processed, it is paused
resource consumption which is charged accordingly. at time t. This assumption is theoretically reasonable and

52
2014 IEEE 22nd International Symposium of Quality of Service (IWQoS)

practically feasible. Theoretically, as long as each task meets that an optimal schedule should have. We then present an
its deadline, the scheduler should have the freedom to assign optimal offline scheduling algorithm under a special concave
the resources in order to reduce the cost. Practically, there cost function.
are many approaches of dynamically assigning the resources
for each job, e.g., CPU time implemented by Xen, memory A. Scheduling with General Concave Cost Functions
ballooning by VMWare, live VM migration by most of the Lemma 1. Assume that f is a positive, non-decreasing, and
Hypervisors. Formally, we require that ri (t) be piecewise con- concave function. Then for any I = [t1 , t2 ], any positive
function x(t), and any positive value u suptI x(t), the
P R(t) as the
stant with finitely many discontinuities. We define
total allocated resource at time t, i.e., R(t) = iI(t) ri (t). following inequality holds:
Associated with the allocated resource R(t) is a cost C(t), Z Z Z
which can be approximated by a non-decreasing function f , f (x(t))dt f (0)dt + f (u)dt, (7)
I I I
i.e.,
C(t) = f (R(t)). (1) where I and I are two subintervals of I such that
R
We assume a proportional cost sharing scheme, i.e., the cost x(t)dt
I = I + I , kI k = I
.
to pay for a task is proportional to the amount of resource the u
task uses. Therefore, the cost for task Ji at time t is calculated Proof. We have
as: Z
ri (t) f (x(t))dt
Ci (t) = f (R(t)). (2)
R(t) ZI
f (x(t)) f (0)
Given a set of n tasks J1 , J2 , . . . , Jn over the interval [0, T ], = x(t) + f (0)dt
x(t)
a feasible schedule consists of resource functions ri (t), i = ZI
f (u) f (0)
1, . . . , n, defined over [0, T ] that satisfy: x(t) + f (0)dt
u
R tdi ZI
f (u) x(t)
Z
ta i
r (t)dt wi , i = 1, . . . , n, (3)
i = x(t)dt + f (0)(1 )dt
0 ri (t) ui , t [tai , tdi ], i = 1, . . . , n, u u
(4) ZI Z I

/ [tai , tdi ], i = 1, . . . , n.
ri (t) = 0, t (5) = f (u)dt + f (0)dt.
I I
The optimal resource scheduling problem is to find a Note that the first inequality is because f is a positive, non-
feasible schedule that minimizes the total cost: decreasing, and concave function and u suptI x(t). The
last equality is based on the definitions of I and I .
Z T
min C = f (R(t))dt (6)
ri (t) 0 The practical meaning of Lemma 1 is as follows. If the
Significantly different from previous work on speed scal- cost function is positive, non-decreasing, and concave, the
ing [10], [11], [20], the cost function is not assumed convex in cost optimal way to schedule a job in an interval where no
our case. Instead, it is approximated as a concave function. The other jobs are scheduled is to allocate the maximum possible
optimal task scheduling problem turns out to be minimizing a resource to the job to reduce the processing time for that job.
concave function, which is hard to solve. The lack of convexity With Lemma 1, it is easy to prove the following lemma.
in the cost function invalidates all existing solutions such as Lemma 2. Assume that the cost function is positive, non-
those in [10], [11], [20]. The assumption that the service decreasing, and concave. Assume that there is a feasible
providers have unlimited resource to provision differentiates schedule, denoted by S, for a given set of n tasks J1 , . . . , Jn .
our work from existing works with explicit resource con- For any time interval [tk , tk+1 ], if S allocates to task Ji
straints [21]. the resource ri (t) < ui , t [tk , tk+1 ], then there exists
III. O FFLINE R ESOURCE S CHEDULING another feasible schedule, S , that behaves the same as S
for t
/ [tk , tk+1 ] but allocates resource ui to Ji in a sub-
Minimization with a concave cost function usually falls into interval of [tk , tk+1 ]. In addition, the total cost of S is no
the class of NP-hard problem, for example, the concave net- larger than that of S, i.e., C(S ) C(S).
work flow problem [14]. This partially suggests the hardness of
our scheduling problem. Though we have not formally proved Proof. Denote I = [tk , tk+1 ]. Define any two time instants
its NP-harness, we have discovered the properties of opti- tk , tk+1 such that
mal scheduling with a general concave cost function. These R
ri (t)dt
properties provide us with valuable insights on making cost- tk tk < tk+1 tk+1 , ktk+1 tk k = I .
efficient decisions in offline and online resource scheduling. ui
Furthermore, these properties have inspired us to find an We can compress the execution time of task Ji into the
optimal offline scheduling algorithm for a special concave time period I = [tk , tk+1 ] with less total cost, by assigning
cost function. In this section, we first present the properties Ji the maximum resource ui in I and no resource in the

53
2014 IEEE 22nd International Symposium of Quality of Service (IWQoS)

Concave function f(x)


time period I = I I . This version of schedule is called a b
compressed schedule,Pdenoted by S .
Denote R (t) =
jI(t),j6=i rj (t), i.e., R(t) = R (t) +
a
ri (t). Define f (x(t)) = f (x(t) + R (t)). Since the cost
function f is positive, non-decreasing, and concave, f is also
positive, non-decreasing, and concave. Based on Lemma 1, we
have
Z Z Z R1 R1+u R2 R2+u
f (ri (t))dt f (0)dt + f (ui )dt, (8)
I I I Fig. 2: Auxiliary diagram for Lemma 3
equivalently,
Z Z Z there does not exist a scheduled job J such that a segment

f (R(t))dt f (R (t))dt + f (R (t) + u)dt. (9) of the allocated processing time for J can be reassigned to
I I I another time interval which has a higher scheduled resource
In other words, C(S) C(S ). In addition, since the schedule (excluding the resource allocated to J) than the interval this
S is feasible, the schedule S is also feasible because it does segment was allocated to.
not impact any deadlines. Unfortunately, the converse of Corollary 1 is not true. We
The practical meaning of Lemma 2 is that whenever have the following counter example. Let J1 =< 0, 1, 1, 1 >,
resource is allocated to a job Ji , the optimal solution should J2 =< 0, 2, 2, 2 >, J3 =< 1, 3, 2, 2 > and J4 =< 2, 3, 1, 1 >
allocate its maximum resource ui . be four jobsto be scheduled. We assume that the cost function
is f (x) = x. Fig. 3 (a) shows a globally optimal schedule
Lemma 3. Assume that the cost function is positive, non- with the optimal cost 2 3 3.46 which satisfies the property
decreasing, and concave. Given a job J =< ta , td , w, u > of Corollary 1. Fig. 3 (b) shows a non-optimal schedule which
which can be scheduled into two time intervals I1 and I2 with
allocated resource R1 and R2 , such that w w satisfies the condition of Corollary 1 with a cost of 2 +
also
u kI1 k, u kI2 k 4 = 4.
and R1 R2 , then the cost of allocating resource u to J
for a duration of w
u within interval I1 leads to a smaller total
B. Scheduling under a Linear Function with a fixed cost
cost compared to allocating resource u to J for a duration of In this section, we propose an optimal offline scheduling
w
u within interval I2 . algorithm under a special concave cost function which is a
Proof. According to Lemma 2, we only need to consider the linear function with a fixed cost.
cases that J is scheduled with the maximum possible resource, f (x) = Hx + K (x) (11)
u. Therefore, it is sufficient to prove the following inequality:
where H, K > 0 and (x) {0, 1}. H stands for the unit
f (u + R1 ) y + f (R1 )(kI1 k y) + f (R2 )kI2 k resource price, K stands for the fixed cost and (x) is a binary
f (u + R2 ) y + f (R2 )(kI2 k y) + f (R1 )kI1 k, (10) function of x ( = 1 when x > 0 and = 0 when x = 0). A
linear function with a fixed cost is commonly used in practice,
w
where 0 < y u. which has a straightforward business justification. In many
By concavity of f (x) and the condition that R1 R2 , the cases, whenever some service is provided, it will incur a fixed
following inequality holds: cost that is independent of the service quantity, for example,
(f (u + R1 ) f (R1 )) (f (u + R2 ) f (R2 )) 0, the cost incurred for system monitoring and administration,
or a minimum revenue asked by the service provider for any
This can be easily explained using Fig. 2. As shown in Fig. 2, single transaction. Let S be an arbitrary schedule, the cost can
we let a = f (u+R1 )f (R1 ) and b = f (u+R2 )f (R2 ). The be written as,
gradient of a positive, non-decreasing and concave function is X
C(S) = KkI k + H wi (12)
a positive and non-increasing function. Therefore, we have
i
a b. This implies that,

where I is the union of the
P time intervals that are occupied
y (f (u + R1 ) f (u + R2 )) y (f (R1 ) f (R2 )) 0 by at least one job. As H i wi is constant when all jobs are
scheduled, the problem becomes minimizing the total length
Therefore, (10) holds.
of I . We replace Lemma 3 for general concave functions with
We note that Lemma 2 and Lemma 3 are true for any the following two lemmas for the special case cost function.
concave cost function f (x). Connecting Lemma 3 to the re-
Definition 1. We first define the term latest possible start time
source scheduling problem, we immediately get the following
for job Ji =< tai , tdi , wi , ui > as Li = tdi wui where wi
i
corollary.
stands for the remaining workload of Ji during the scheduling
Corollary 1. Assume that the cost function is positive, non- process. Let = mini {Li } indicate the smallest latest possible
decreasing, and concave. If a schedule S is optimal, then, start time.

54
2014 IEEE 22nd International Symposium of Quality of Service (IWQoS)

4 4
3 3 J3

Resource

Resource
2 J2 J3 2
1 1 J2
J1 J4 J1 J4
0 1 2 3 0 1 2 3
Time Time
(a) (b)
Fig. 3: (a) A globally optimal schedule (b) A non-optimal schedule which satisfies the condition of Corollary 1

Lemma 4. Let SJ = {Ji |i = 1, . . . , n} be a set of n jobs to be


scheduled and = mini {Li } be the smallest latest possible 10
start time among all jobs. Assume that the cost function is
a linear function with a fixed cost, as defined in (11). There J2

Resource
exists an optimal schedule in which no jobs are scheduled
5
before . J1 J1
J2 J3
Proof. Suppose we have a set of n jobs, SJ = {Ji |i =
1, . . . , n} and Ji =< tai , tdi , wi , ui >, to be allocated in time J2 J2 J1
interval [0, T ], where T is the maximum time instance. Let
g be an arbitrary schedule of SJ . We will show that we can 0 1 2 3 4 5 6 7 8 9
reallocate the workload which is scheduled in [0, ] by g to Time
[, T ] without incurring the total cost. Fig. 4: An example which demonstrates the reallocation
Let I0 (g) be the union of intervals with at least one job procedure in the proof of Lemma 4
scheduled in g. Let I denote the entire time space, i.e. I =
[0, T ].
Step 1: We reallocate the workload of Ji to the time intervals (denoted by the shaded boxes in Fig. 4) to three jobs J1 =<
(I0 (g) {t| < t < tdi }) as much as possible. We call the 1, 7, 4, 2 >, J2 =< 0, 8, 6, 3 > and J3 =< 7, 9, 12, 6 >. The
resulting schedule g 1 . According to (12), C(g 1 ) C(g). Let latest possible start time for these three jobs are L1 = 5,
xi be the amount of workload from Ji that is allocated in [0, ] L2 = 6, and L3 = 7, respectively. We now apply the
by g 1 . reallocation procedure in the proof of Lemma 4 to obtain an
Step 2: Let SJ = {Ji |xi > 0, Ji SJ } and Jm =< alternative optimal schedule in which no jobs are allocated
tm , tdm , wm , um > be such that tdm = minJi SJ (tdi ). We
a before = 5. Since J1 has the smallest latest possible start
reschedule the workload of Jm which is scheduled in [0, ] time, according to Step 1 of Lemma 4, we first reallocate 3
(with an amount of xm ) by g 1 into the intervals ((I I0 (g)) units of J2 s workload from time interval [1, 2] to [7, 8]. Then,
{t| < t < tdm }). This is feasible as the entire workload of Jm according to Step 2, J1 is selected. We reschedule 4 units
can be scheduled in [, T ]. After the reallocation, all workload of J1 s workload from [1, 2] and [3, 4] to [5, 7]. According to
of Jm is scheduled in [, T ]. Step 3, we reallocate 3 units of J2 s workload from [3, 4] to
Step 3: For convenience, we let I(Jm , g) and I(Jm , g 1 ) [5, 6]. Now, all jobs are allocated after time instance 5. We can
be the sets of time intervals where g and g 1 allocate Jm , observe that the total length of intervals with at least one job
respectively. We reallocate the workload of Ji SJ from scheduled remains to be 4 after the reallocation. Therefore,
(I(Jm , g)[0, ]) to (I(Jm , g 1 )[, T ]). This is also feasible the cost remains the same. According to Lemma 4, we can
as tdi tdm . We call the resulting schedule g 2 . optimally schedule a job, Ji , in [, tdi ] if Li = .
We repeatedly perform Steps 2-3 on g 2 and any subsequent Under the linear cost function (11), it is trivial that, if a
schedules until all jobs are reallocated to [, T ]. We call the job has to be allocated to a particular time interval, allocating
resulting schedule g k . Let Ik (g) denote the union of intervals other jobs as much as possible to this time interval will not
with at least one job scheduled in g k . By Step 2 and 3, it is incur additional cost. Combining with Lemma 4, we find a
obvious that kIk (g)k kI0 (g)k. Hence, C(g k ) C(g). The deterministic procedure which leads to an optimal schedule
same procedure can also be applied to an optimal schedule. under the cost function (11). This procedure is presented in
Hence, there exists an optimal schedule such that no jobs are Algorithm 1. As there are a pair nested loops which iterate over
scheduled before . n jobs, Algorithm 1 has an complexity of O(n2 q), where q
is the maximum number of reallocation to be performed on
We demonstrate the proof of Lemma 4 using an example one job in each step.
shown in Fig. 4. We assume that the cost function is in
the form of (11). A cost-optimal schedule allocates resource Theorem 1. Assume that the cost function is in the form of

55
2014 IEEE 22nd International Symposium of Quality of Service (IWQoS)

1 Input: SJ , the set of all jobs; tasks in advance and has to make decision with information
2 while SJ 6= do only available so far.
3 Calculate Li for all Ji SJ using Definition 1; We denote by CON the total cost induced by an online
4 = mini Li ; scheduling algorithm and by C the total cost induced by
5 tdmax = 0 the offline optimal scheduling algorithm. We use competitive
6 for Ji SJ do ratio which is defined below to evaluate how close the online
7 if Li = then scheduling is to the offline optimal algorithm.
8 Schedule Ji in [, tdi ]; Definition 2. An online scheduling algorithm is -competitive
9 SJ = SJ {Ji }; if there exists a constant such as
10 tdmax = max(tdmax , tdi );
11 end CON C + (13)
12 end
holds for any input. We call the competitive ratio.
13 for Ji SJ do
14 if < tdi then If the online is not deterministic, then CON is a random
15 Schedule the remaining workload of Ji as variable and in this case, the competitive ratio is defined as:
much as possible in interval [, tdmax ] with
Definition 3. A randomized online scheduling algorithm is
resource ui ;
-competitive if there exists a constant such as
16 Update wi as the amount of the
unscheduled workload of Ji ; E[CON ] C + (14)
17 if wi = 0 then
18 SJ = SJ J i ; holds for any input, where E is the expectation taken over the
19 end random choices made by the online algorithm.
20 end It is clear that the competitive ratio is higher than 1, and the
21 end smaller the competitive ratio, the closer the online algorithm
22 end to the offline optimal solution.
Algorithm 1: Optimal scheduling algorithm with a
linear cost function plus positive fixed cost B. Randomized Online Stack-Centric Scheduling Algorithm
(ROSA)
To present ROSA formally, we first define the concept of
(11). Scheduling by Algorithm 1 is optimal. task density of an time interval.
Proof. The proof directly follows Lemma 4. Definition 4. Assume that there are a set of n tasks Ji =<
tai , tdi , wi , ui >, i = 1, . . . , n. Let S be a schedule of a subset
In this section, we introduced a special case cost function of {Ji }. The task density of a time interval I is defined as
and an algorithm to perform cost optimal job allocation under n
such cost function. In Section V, we use this offline algorithm d(I) =
X
(I Ii (S)) ui , (15)
to evaluate the randomized online algorithm introduced in i=1
Section IV.
where Ii (S) stands for the union of the intervals where Ji is
IV. A R ANDOMIZED O NLINE A LGORITHM scheduled in S (Ii (S) = if Ji is not scheduled), (x) = 1
if x 6= and 0 otherwise.
In this section, we introduce an efficient online scheduling
algorithm with a positive, non-decreasing and concave cost The basic idea of our online algorithm, shown in Algo-
function f (x). The basic idea of our online algorithm is to rithm 2, is to sequentially allocate jobs in the order they
stack the processing times of multiple jobs whenever possible are submitted. Algorithm 2 makes local optimal schedule on
and run the jobs with the maximum possible resource in order allocating each job, using information available so far. The
to reduce the total cost. We prove the lower bound for the local optimality of Algorithm 2 can be verified using Lemma 2
competitive ratio of the proposed online algorithm against the and Lemma 3. When the scheduler allocates the processing
optimal schedule. time for a job, J =< ta , td , w, u >, it always allocates
the job with its maximum possible resource, u. Also, when
A. Online Scheduling and Expected Competitive Ratio scheduling the workload of J, we consider the time intervals
The online resource scheduling problem assumes that, at within the range of [ta , td ] in the order that the interval with
any time instant t, the scheduler only knows the tasks which the highest scheduled workload comes first. After allocating
arrive upon or before t. Other than that, the scheduler does as much workload as possible to the current time interval,
not rely on any knowledge of future information. Online task we go on to the next interval until all of the workload of
scheduling is required in many cases, because the cloud service J is accommodated. In this way, the resulting schedule after
provider or service broker may not have information of all allocating each job always complies with the conditions of

56
2014 IEEE 22nd International Symposium of Quality of Service (IWQoS)

both Lemma 2 and Lemma 3. Algorithm 2 selects a random At time 0, one task, denoted as task 1, with u1 = n +
start time for (remaining) jobs in time intervals with task 1, w1 = 2(n + 1), and deadline of instant 2n arrives.
intensity of 0 (i.e., no overlapping tasks). Such randomization The first group of n 1 tasks, tasks 2, . . . , n with ui =
offers an opportunity for the current task in consideration 1, wi = 1(i = 2, . . . , n), arrive randomly during the time
to overlap with future unknown incoming tasks. We refer to interval (0, n 1], all having the same deadline of instant
this algorithm as a randomized online stack-centric algorithm n.
(ROSA). The second group of n 1 tasks, tasks n + 1, . . . , 2n 1
with ui = 1, wi = 1(i = n + 1, . . . , 2n) arrive randomly
1 Initialization: an ordered set of time instants during the time interval [n + 1, 2n 1], all having the
I = ; same deadline of instant 2n.
2 while an task Ji arrives do First, we derive the optimal total cost on the random
3 Insert time instants tai and tdi into I; instance. Since the first group of tasks and the second group
4 Find all subintervals [tai , tdi ], each of tasks have no overlap in time, tasks in the first group have
representing a time period in between two no way to be scheduled with any task in the second group.
adjacent time instants in I, and mark them as Obviously, the optimal schedule on this random instance is to
unprocessed; equally split the workload of task 1 into two parts, and then
5 while wi > 0 do schedule the first half and the second half of task 1 with tasks
6 Select the unprocessed subinterval of the first group and tasks of the second group, respectively.
[tai , tdi ], denoted by [t1 , t2 ], that has the The optimal total cost is constant and equals 2f (2n).
highest task density (randomly select one We only need to consider reasonable deterministic online
if there is a tie); algorithms. We call an online algorithm reasonable if it has
7 if the task intensity of [t1 , t2 ] equals 0 the following properties:
then 1) The algorithm makes schedules only with information
8 if t1 > t2 w ui then
i
available so far, and when the schedule of a job is de-
9 Return task Ji is infeasible; termined, the algorithm should not change the schedule
10 end at a later time.
11 Randomly select an instant 2) Whenever resource is allocated to a job Ji , the algorithm
t2 [t1 , t2 wui ];
i
should allocate its maximum resource ui .
12 Allocate ui to Ji in [t2 , t2 + w ui ];
i
3) When there is not enough information to make a better
wi
13 Insert t2 and t2 + ui into I; schedule for a task, the algorithm should not split the
14 else workload of the task.
15 Allocate ui to Ji in The first property is because the algorithm needs to be online;
[t1 , min{t2 , t1 + w ui }];
i
the second property is because of Lemma 2; the third property
wi
16 Insert t1 + ui into I if it is smaller is because ROSA works in the same way (refer to Algorithm 2:
than t2 ; line 7 to line 13).
17 end Any reasonable deterministic online algorithm will have to
18 Update wi = max{0, wi ui kt2 t1 k}; start scheduling task 1 at some point in time before time 2n2
19 Mark this subinterval as processed; (otherwise the deadline cannot be met). Consider an algorithm
20 end that makes a schedule to execute task 1 at time t [0, 2n 2].
21 end There are three possible scenarios:
Algorithm 2: ROSA- Randomized online stack- 1) Case t [0, n 1]: In this case, task 1 has to be
centric algorithm scheduled with jobs in the first group. Clearly, the cost
of any online algorithm on scheduling task 1 and the
Theorem 2. ROSA has the competitive ratio no less than 12 + jobs in the first group is no less than the cost of the
f (n1)+f (n+1) best solution, which is f (n + 1) + f (2n). That is, the
2f (2n) , where n is the total number of jobs and f is
minimum cost for executing these jobs is to stack all jobs
a positive, non-decreasing, and concave cost function.
together, resulting in the cost of f (n+1+n1) = f (2n)
Proof. We prove the theorem based on Yaos minimax prin- for the overlapping period and the cost of f (n + 1) for
ciple [19], i.e., to establish a lower bound on the performance finishing the rest workload of job 1.
of a randomized algorithm, it suffices to find an appropriate Similarly, the cost of any online algorithm on scheduling
distribution of inputs, and to prove that no deterministic algo- jobs in the second group is no less than the minimum
rithm can have the cost smaller than the lower bound against cost, which is f (n 1).
that distribution. As such, we specify a random instance of Therefore, the total cost of any online algorithm is no
the problem and analyse what any algorithm could attain in less than f (n 1) + f (n + 1) + f (2n).
expectation on this random instance. 2) Case t [n 1, n + 1]: Any online algorithm has a cost

57
2014 IEEE 22nd International Symposium of Quality of Service (IWQoS)

no less than TABLE I: Parameters for Competitive Ratio Analysis


Parameter Description
f (n 1) + f (n + 1) + f (2n). (16) H, K Parameters for the cost function described in (11), vary
from three different settings : H = 1, K = 0.1 (small
For t [n1, n+1], Equation (16) represents the best fixed cost), H = 1, K = 0.5 (medium fixed cost) and
possible solution that stacks all jobs in the first group H = 1, K = 1 (large fixed cost).
into the time period [n 1, n] and stacks all jobs in the T Number of hours of the simulation period, fixed to 1000
dmax The maximum time duration a job has to be processed (
second group into the time period [n + 1, n + 2]. wi
dmax , i), fix to 5
ui
3) Case t [n + 1, 2n 2]: The analysis of this case is umax The maximum resource allocated to a job (ui
similar to that in the first case. The lower bound of the umax , i), fixed to 0.5
online algorithm is f (n 1) + f (n + 1) + f (2n). N Number of jobs, vary from 500 (sparse) to 5000 (dense)
To summarize, the total cost of any reasonable deterministic
online algorithm on this random instance is no less than f (n when increases. This indicates that, given more flexibility
1)+f (n+1)+f (2n). Since the total cost of the optimal offline of job execution time, ROSA can achieve a better competitive
solution is 2f (2n), Theorem 2 follows. ratio. From Fig. 5, we can also see that the competitive ratio
From Theorem 2, we easily have the following corollaries: largely depends on the ratio between the fixed cost K and the
unit price H.
Corollary 2. Assume that the cost function has the form
f (x) = n , where 0 < < 1. ROSA has the competitive B. Trace Driven Simulation with Generic Concave Cost Func-
ratio no less than 12 + 21 when n . tions
Corollary 3. Assume that the cost function is in the form of In the second set of experiments, we conduct simulations
(11). ROSA has the competitive ratio no less than 1 when based on Google cluster data [5] which has been widely used
n . to perform cloud computing related simulations. The trace data
contains a large number of job records coming from 933 users.
Based on Corollary 2, the lower bound of the competitive It is recorded for a 29-day duration in May 2011 on a cluster of
ratio of ROSA is 1.207 when = 0.5. While the lower bound 11K physical machines. The size of the trace data is over 180
of Corollary 3 is meaningless in the sense that the competitive GB. Here, we consider the jobs with explicit computational
ratio has to be larger than 1, our experimental evaluation tasks which can be processed in a deterministic duration given
in Section V shows that ROSA approaches this meaningless the precise processing power of the machine used. To align
lower bound closely, meaning that empirically ROSA is nearly with our problem , we preprocessed the data to eliminate the
optimal. jobs that are not naturally finished (e.g. web services). This
V. E XPERIMENTAL E VALUATION leaves us with 17 million job records coming from 422 users.
In this section, we carry out two sets of experiments. The We first analyse the feature of the trace data. Fig. 6 (a)
first set of experiments aims at evaluating the tightness of shows the distribution of the processing length of the jobs. It
the competitive ratio analysis introduced in Theorem 2. The shows an approximate exponential distribution which is known
second set of experiments aims at evaluating the performance to be heavy-tailed with a small mean. Over 80% of the jobs can
of ROSA under a generic concave cost function in comparison be finished within 30 minutes when working at the requested
to other conventional online scheduling algorithms. speed. Therefore, if we use the same approach introduced in
(17) to generate the deadline of each job, the majority of
A. Competitive Ratio Analysis with the Special Cost Function the jobs can be handled in less than 10 hours, which is a
We test the competitive ratio of ROSA with the special cost reasonable assumption. Fig. 6 (b) shows the distribution of the
function defined by (11). As we have theoretically proved the job CPU rate requirement. As the trace is scaled to eliminate
optimality of Algorithm 1 in Section III, we use Algorithm 1 any confidential content, we cannot retrieve the actual CPU
to compute the optimal cost for each scenario. Apart from rates but a relative scale in the range of [0, 1]. In order to
the parameters, tai , tdi , wi and ui , of job Ji introduced in reduce the computational complexity, we arbitrarily form 42
Section II, we have some additional control parameters for groups of ten users and perform evaluation on each group.
the experiment, as listed in Table I. In addition, the deadline Fig. 6 (c) shows the number of job requests against time for
of Ji , tdi , is generated as follows. five randomly selected groups. We can observe that the curves
wi exhibit distinct patterns with different levels of workloads.
td = (1 + ) + ta , (17) The diversity of the workloads from different groups of users
ui
makes our evaluation result more robust.
Where is a parameter which controls the flexibility of the
The job records of the trace data contain three attributes
incoming jobs for resource scheduling. We choose the value
relevant to our simulation, job submission time, job workload,
of from {1, 5, 10, 20} in this experiment.
and job resource requirement2 . For an arbitrary job Ji , the
The result in Fig. 5 shows that the competitive ratio of
ROSA tends towards 1 as the number of simulated jobs in- 2 We use the CPU rate requirement as the resource requirement of the jobs
creases. Fig. 5 also shows that the competitive ratio decreases for simplicity.

58
2014 IEEE 22nd International Symposium of Quality of Service (IWQoS)

1.4 1.4 1.4


=1 =1 =1
=5 =5 =5
Competitive Ratio

Competitive Ratio

Competitive Ratio
1.3 = 10 1.3 = 10 1.3 = 10
= 20 = 20 = 20

1.2 1.2 1.2

1.1 1.1 1.1

1 1 1
1000 2000 3000 4000 5000 1000 2000 3000 4000 5000 1000 2000 3000 4000 5000
Total Number of VM Requests Total Number of VM Requests Total Number of VM Requests

(a) (b) (c)


Fig. 5: Competitive ratio of ROSA with a linear pricing function plus positive fixed cost. (a) H = 1, K = 0.1 (b) H = 1, K =
0.5 (c) H = 1, K = 1
4
0.25 x 10
0.3 3

Number of Job Submissions


Group 41
Group 33
0.2 Group 37
0.2 2 Group 42
Percentage

Percentage

0.15 Group 0

0.1
0.1 1
0.05

0 0 0
0 1 2 3 0 0.1 0.2 0.3 0 200 400 600
Job Length (Hour) Job CPU Rate Requirement Time (Hour)
(a) (b) (c)
Fig. 6: Analysis of Google Cluster Data. (a) Distribution of job length. (b) Distribution of job requirement. (c) Number of job
submissions
4 4 4
ROSA : FIRSTFIT ROSA : FIRSTFIT ROSA : FIRSTFIT
RANDOM : FIRSTFIT RANDOM : FIRSTFIT RANDOM : FIRSTFIT
3 3 3
Cost Ratio

Cost Ratio

Cost Ratio

2 2 2

1 1 1

0 0 0
0 5 10 15 20 25 0 5 10 15 20 25 0 5 10 15 20 25

(a) = 0.25 (b) = 0.5 (c) = 0.75


Fig. 7: Performance comparison for the online scheduling algorithms ROSA, Firstfit, and Random with continuous concave
cost function f (x) = x
job submission time, tai , indicates when the job is available
to the scheduler. The CPU rate requirement, ui , indicates the
0, x=0
maximum processing speed and the maximum instantaneous


x + 1, 0x<1

resource consumption of Ji . We obtain the job workload, wi , f (x) = x+29 (18)
15 , 1 x < 16
by multiplying the average CPU rate with the processing time

x+284
100 , x > 16

of Ji . Similar to the previous experiment, we set the total
elapsed time, T , as 1000 and we generate the deadline of We compare the performance of ROSA with two other
Ji using the method introduced in (17) with as the control conventional online scheduling algorithms, a nave random
parameter. The cost of a scheduling decision is computed using scheduler, referred to as Random, and the first-fit scheduler,
(2) with two types of cost functions: (a) f (x) = x , 0 < < referred to as Firstfit. The Random algorithm randomly selects
1, and (b) a piecewise linear function defined by (18), which a time interval of length no shorter than w a
ui between ti and ti
i d

complies with the concavity property. to process Ji . The Firstfit algorithm processes the incoming
jobs at their submission time immediately with a finishing time

59
2014 IEEE 22nd International Symposium of Quality of Service (IWQoS)

10

4
algorithm for a special concave pricing function. We have
ROSA : FIRSTFIT developed an online scheduling algorithm and derived its
RANDOM : FIRSTFIT
3 competitive ratio. Simulation results on a Google data trace
Cost Ratio have shown that the proposed online scheduling algorithm
2 outperforms other conventional scheduling algorithms. The
work is the initial step toward studying the behaviours and
1 strategies of cloud service providers, brokers, and end cus-
tomers when offering or facing a pricing model with volume
0 discount. It opens a door for many interesting problems along
0 5 10 15 20 25
this line. For example, how a cloud service provider could
determine its pricing schemes (with volume discount) given
Fig. 8: Performance assessment for the online algorithms the rational customer behaviour of cost saving along with other
ROSA, Firstfit and Random with a piecewise linear cost competitors to increase its revenue. To enjoy volume discount,
function the customers are encouraged to provide loose deadlines which
may degrade user experience. Tight deadlines leave a small
as early as possible. window for cost saving. Further research is required on the
We use such three online algorithms to schedule each of methods of obtaining better trade-off decisions.
the 42 groups of job traces. We run the simulations with five
R EFERENCES
different values of , 1, 5, 10, 15 and 20, respectively. We vary
the cost function f (x) = x by setting to three different [1] Alibaba cloud computing. http://www.aliyun.com/.
[2] Amazon elastic compute cloud (amazon ec2). http://aws.amazon.com/
values, 0.25, 0.5 and 0.75. As the Firstfit algorithm produces cn/ec2/.
the same scheduling decision for different values of , we use [3] Cloud services brokerage (csb) market. http://www.prweb.com/releases/
it as a baseline algorithm. We report the cost ratio of ROSA cloud-services/brokerage-market/prweb11222307.htm.
[4] Gogrid. www.gogrid.com/.
over Firstfit, denoted by ROSA : F irstf it, and the cost ratio [5] Google cluster data. https://code.google.com/p/googleclusterdata/.
of Random over Firstfit, denoted by Random : F irstf it. The [6] Huawei cloud service. http://www.hwclouds.com/.
result is shown in Fig. 7. As shown in Fig. 7, the mean cost [7] Microsoft windows azure. http://www.windowsazure.com/.
[8] Rackspace. http://www.rackspace.com/.
ratios between ROSA and Firstfit over 42 grouped user traces [9] Readyspace. http://www.readyspace.com/.
are smaller than 1 under all parameter settings. Especially [10] L. Andrew, A. Wierman, and A. Tang. Optimal speed scaling under
for the cases when = 0.25, the mean ratios are 0.8967, arbitrary power functions. ACM SIGMETRICS Performance Evaluation
Review, 37(2):3941, 2009.
0.7595, 0.6605, 0.6094, and 0.5597 for = 1, 5, 10, 15, and [11] N. Bansal, H. Chan, and K. Pruhs. Speed scaling with an arbitrary
20, respectively. Practically, the customers are able to get a power function. In Proceedings of the twentieth Annual ACM-SIAM
10% cost saving if the interval between the submission time Symposium on Discrete Algorithms (SODA), pages 693701, 2009.
[12] P. Charalampous. Increasing the adoption rates of cloud comput-
and deadline of each job is two times of the duration for ing. http://www.academia.edu/3400195/Increasing the adoption rates
processing the job at its maximal speed. of cloud computing.
Fig. 8 shows the cost ratio assessment for the three online [13] N. Gohring. Confirmed: Cloud infrastructure pricing is
absurd. http://www.itworld.com/cloud-computing/387149/
algorithms with a piecewise linear cost function defined by confirmed-cloud-iaas-pricing-absurd.
(18). We can observe that the cost ratio between ROSA and [14] G. Guisewite and P. Pardalos. Algorithms for the single-source uncapac-
Firstfit is 0.8834, 0.7368, 0.6321, 0.5812 and 0.5311 when itated minimum concave-cost network flow problem. Journal of Global
Optimization, 1(3):245265, 1991.
= 1, 5, 10, 15 and 20, respectively. Under such piecewise [15] T. Henzinger, A. Singh, V. Singh, T. Wies, and D. Zufferey. Flexprice:
linear but approximately concave cost function, the customers Flexible provisioning of resources in a cloud environment. In Cloud
are able to obtain similar benefit as that under the cost function Computing (CLOUD), 2010 IEEE 3rd International Conference on,
1 pages 8390, 2010.
of f (x) = x 4 . [16] R. Van den Bossche, K. Vanmechelen, and J. Broeckhove. Cost-efficient
scheduling heuristics for deadline constrained workloads on hybrid
VI. C ONCLUSIONS clouds. In Cloud Computing Technology and Science (CloudCom), 2011
IEEE Third International Conference on, pages 320327, 2011.
Cloud is an emerging computing market where cloud [17] W. Wang, D. Niu, B. Li, and B. Liang. Dynamic cloud resource
providers, brokers, and users share, mediate, and consume reservation via cloud brokerage. In ICDCS, 2013.
computing resource. With the evolution of cloud computing, [18] C. Weinhardt, A. Anandasivam, B. Blau, N. Borissov, T. Meinl,
W. Michalk, and J. Stosser. Cloud computing a classification, business
Pay-as-you-go pricing model has been diversified with the models, and research directions. Business & Information Systems
flavours of volume discount, which stimulate the users adop- Engineering, 1(5):391399, 2009.
tion to cloud computing. In this paper, we study how a broker [19] A. Yao. Probabilistic computations: Toward a unified measure of
complexity. In Proceedings of IEEE Symp. Foundations of Computer
can schedule the jobs of users to leverage the pricing model Science (FOCS), pages 222227, 1977.
with volume discount so that the maximum cost saving can be [20] F. Yao, A. Demers, and S. Shenker. A scheduling model for reduced
achieved for its customers. We have analysed the properties cpu energy. In Proceedings of IEEE Symp. Foundations of Computer
Science (FOCS), pages 374382, 1995.
that an optimal solution should have and we conjecture that [21] G. Zhai, L. Tian, Y. Zhou, and J. Shi. Load diversity based optimal
the scheduling problem is NP-hard for general concave pricing processing resource allocation for super base stations in centralized radio
functions. We have developed an offline optimal scheduling access networks. Science China Information Sciences, 57(4):112, 2014.

60

You might also like