Abstract
This article discusses scheduling strategies for the problem of maximizing the expected number of tasks that can be executed on a cloud platform within a given budget and under a deadline constraint. The execution times of tasks follow independent and identically distributed probability laws. The main questions are how many processors to enroll and whether and when to interrupt tasks that have been executing for some time. We provide complexity results and an asymptotically optimal strategy for the problem instance with discrete probability distributions and without deadline. We extend the latter strategy for the general case with continuous distributions and a deadline and we design an efficient heuristic which is shown to outperform standard approaches when running simulations for a variety of useful distribution laws.
1. Introduction
This article deals with the following problem: given an infinite bag of stochastic tasks, and an infinite set of available virtual machines (VMs or processors 1 ), how to successfully execute as many tasks as possible in expectation, under both a budget and a deadline constraint? The execution times of the tasks are independent and identically distributed (IID) random variables that follow a common probability distribution. The amount of budget spent during the execution of a given task is proportional to the length of its execution. At each instant, the scheduler can decide whether to continue the execution (until success) or to interrupt the task and start a new one. Intuitively, the dilemma is the following: (i) continuing execution means spending more budget, and taking the risk of waiting very long until completion, but it capitalizes on the budget already spent for the task and (ii) interrupting the task wastes the budget already spent for the task, but enables starting afresh with a new, hopefully shorter task. Of course there is a big risk here, since the new task could turn out to have an even longer execution than the interrupted one.
This task model assumes that some tasks may not be executed in the end. In fact, there are three cases: (i) some tasks are launched and reach completion, meaning that they are successfully executed: (ii) some tasks are launched but they are interrupted before completion, meaning that their execution has failed; and (iii) some tasks are not launched at all. The objective is to maximize the number of successful tasks, given the deadline and budget constraints.
This task model is very closely related to imprecise computations (Amirijoo et al., 2006; Chung et al., 1990; Liu et al., 1991), particularly in the context of real-time computations. In imprecise computations, it is not necessary for all tasks to be completely processed to obtain a meaningful result. Most often, tasks in imprecise computations are divided into a mandatory and an optional part: while the execution of all mandatory parts is necessary, the execution of optional parts is decided by the user. Often the user has not the time or the budget to execute all optional parts, and she must select which ones to execute. Our work perfectly corresponds to the optimization of the processing of the optional parts. Among domains where tasks may have optional parts (or some tasks may be entirely optionals), one can cite recognition and mining applications (Meng et al., 2009), robotic systems (Hassan et al., 2001), speech processing (Feng and Liu, 1993), and also cites multimedia processing, planning and artificial intelligence, and database systems (Kobayashi and Yamasaki, 2004). In these applications, the processing times of the optional parts are heavily data-dependent, hence the need to estimate them via a probability distribution.
In addition to imprecise computations, this scheduling problem naturally arises with many applications in the context of information retrieval (see Section 2 for a detailed discussion). Informally, the goal is to extract as much information as possible, by launching analysis tasks whose execution time strongly depends upon the nature of the data sample being processed. A typical example is a set of image files, whose processing times heavily depend upon the elements that are present (or not) within each image. Not all data sample must be processed, but the larger the number of data samples successfully processed, the more accurate the analysis.
The scheduler must decide which tasks to interrupt and when, but it must also decide how many processors to enroll (this is the resource provisioning problem). There is again a trade-off here. On the one hand, enrolling many processors is mandatory when the deadline is small and the budget is large, and it allows us to make better scheduling decisions, because we can dynamically observe many events taking place in parallel. 2 On the other hand, enrolling too many processors increases the risk of having many unfinished tasks when budget runs out and/or when deadline strikes.
The main contributions of this work are the following: We provide a comprehensive set of theoretical results for the problem instance with discrete distributions and no deadline. These results show the difficulty of the general scheduling problem under study and lay the foundations for its analysis; We design an asymptotically optimal scheduling strategy for the above problem instance (discrete distribution, no deadline); We design an efficient heuristic, O We report a set of simulation results for three widely used probability distributions (exponential, uniform, and lognormal) that demonstrate both the superiority of the O
2. Related work
This work falls under the scope of cloud computing since it targets the execution of sets of independent tasks on a cloud platform under a deadline and a budget constraints. However, because we do not assume to know in advance the execution time of tasks (we are in a non-clairvoyant setting), this work is also closely related to the scheduling of bags of tasks. We survey both topics in Sections 2.1 and 2.2. Finally, in Section 2.3, we survey task models that are closely related to our model.
2.1. Cloud computing
There exists a huge literature on cloud computing, and several surveys review this collection of work (Bokhari et al., 2018; Singh and Chana, 2016a, 2016b). Singh and Chana (2016a) published a recent survey devoted solely to cloud resource provisioning, that is, the decision of which resources should be enrolled to perform the computations. Resource provisioning is often a separate phase from resource scheduling. Resource scheduling decides which computations should be processed by each of the enrolled resources and in which order they should be performed.
Resource provisioning and scheduling are key steps to the efficient execution of workflows on cloud platforms. The multiobjective scheduling problem that consists in meeting deadlines and either respecting a budget or minimizing the cost (or energy) has been extensively studied for deterministic workflows (Abrishami et al., 2013; Arabnejad et al., 2016; Byun et al., 2011; Calheiros and Buyya, 2014; Fard et al., 2013; Gao et al., 2013; Malawski et al., 2012; Malawski et al., 2015; Wu et al., 2015) but has received much less attention in a stochastic context. Indeed, most of the studies assume a clairvoyant setting: the resource provisioning and task scheduling mechanisms know in advance, and accurately, the execution time of all tasks. A handful of additional studies also consider that tasks may fail (Liu et al., 2010; Poola et al., 2014). Among these articles, Poola et al. (2014) differ as they assume that tasks have uncertain execution times. However, they assume they know these execution times with a rather good accuracy (the standard deviation of the uncertainty is 10% of the expected execution time). They are thus dealing with uncertainties rather than a true non-clairvoyant setting. The work by Caniou et al. (2018) targets stochastic tasks but is limited to taking static decisions (no task interruption).
Some works are limited to a particular type of application like MapReduce (Hwang and Kim, 2012; Tian and Chen, 2011). For instance, Tian and Chen (2011) consider MapReduce programs and can either minimize the financial cost while matching a deadline or minimize the execution time while enforcing a given budget.
Our task model applies to compute-bound tasks because we do not account for communication times and instead assume that they are negligible in front of computation times. However, we refine the classical deterministic model by adding stochasticity to task execution times.
2.2. Bags of tasks
A bag of tasks is an application comprising a set of independent tasks sharing some common characteristics: either all tasks have the same execution time or they are instances coming from a same distribution. Several works devoted to bag-of-tasks processing explicitly target cloud computing (Grekioti and Shakhlevich, 2014; Oprescu et al., 2012). Some of them consider the classical clairvoyant model (Grekioti and Shakhlevich, 2014), while some target a non-clairvoyant setting (Casanova et al., 2010). A group of authors including Oprescu and Kielmann have published several studies focusing on budget-constrained makespan minimization in a non-clairvoyant settings (Oprescu and Kielmann, 2010; Oprescu et al., 2011; Oprescu et al., 2012). They do not assume they know the distribution of execution times but try to learn it on the fly (Oprescu and Kielmann, 2010; Oprescu et al., 2011). This work differs from ours as these authors do not consider deadlines. For instance, in the work by Oprescu et al. (2012), the objective is to try to complete all tasks, possibly using replication on faster machines, and, in case the proposed solution fails to achieve this goal, to complete as many tasks as possible. The implied assumption is that all tasks can be completed within the budget. We implicitly assume the opposite: there are too many tasks to complete all of them by the deadline, and therefore we attempt to complete as many as possible and avoid replication, which would be a waste of resources.
Vecchiola et al. (2012) consider a single application comprising independent tasks with deadlines but without any budget constraints. In their model, tasks are supposed to have different execution times but they only consider the average execution time of tasks rather than its probability distribution (this is left for future work). Moreover, they do not report on the amount of deadline violations; their contribution is therefore hard to assess. Mao et al. (2010) consider both deadline and budget-constrained provisioning and assume they know the tasks execution times up to some small variation (the largest standard deviation of a task execution time is at most 20% of its expected execution time). Hence, this work is more related to scheduling under uncertainties than to non-clairvoyant scheduling.
2.3. Task model
Our task model assumes that some tasks may not be executed in the end. As mentioned in the introduction, this framework is very closely related to imprecise computations (Amirijoo et al., 2006; Chung et al., 1990; Liu et al., 1991). Furthermore, this task model also corresponds to the overload case of Buttazzo (2012) where jobs can be skipped or aborted. Another, related model, is that of anytime tasks (Jumel and Simonot-Lion, 2003) where a task can be interrupted at any time, with the assumption that the longer the running, the higher the quality of its output. Such a model requires a function relating the time spent to a notion of reward. Finally, we note that the general problem related to interrupting tasks falls into the scope of optimal stopping, the theory which consists in selecting a date to take an action to optimize a reward (Ferguson, 2008).
Altogether, the present study appears to be unique because it is non-clairvoyant and assumes an overall deadline in addition to a budget constraint. Our main result is to characterize a distribution-dependent threshold at which all tasks should be interrupted and to show the excellent behavior of this approach in practice.
3. Problem definition
This section details the framework and scheduling objective.
3.1. Tasks
We aim at scheduling a set of independent tasks whose execution times are IID random variables. The common probability distribution of the execution time is denoted as
3.2. Platform
The execution platform is composed of identical VMs or processors. Without loss of generality, we assume unit speed and unit cost for each VM and scale the task execution times when we aim at changing granularity. Execution time and budget are expressed in seconds. There is an unlimited number of VMs that can be launched by the user.
3.3. Constraints and optimization objective
The user has a limited budget b and an execution deadline d. The optimization problem is to maximize the expected number of tasks that can be completed until (i) the deadline is reached and (ii) the totality of the budget is spent. More precisely: The scheduler decides how many VMs to launch and which VMs to stop at each second; Each VM executes a task as soon as it is started; Each VM is interrupted as soon as the deadline or the budget is exceeded, whichever comes first; Each task can be deleted by the scheduler at any second before completion; The execution of each task is non-preemptive, except in Section 4.2 that summarizes complexity results. In a non-preemptive execution, interrupted tasks cannot be relaunched, and the time/budget spent computing until interruption is completely lost. On the contrary, in a preemptive execution, a task can be interrupted temporarily (e.g. for the execution of another task, or until some event on another VM) and resumed later on.
4. Discrete distributions
This section provides theoretical results when execution times follow a discrete probability distribution
In this section, we further assume that there is no scheduling deadline d, or equivalently, that the deadline is equal to the budget:
4.1 Example
We consider the following example with
4.1.1. With a single processor
Let
Therefore, the optimal expectation with a single processor is to complete 1.2 tasks. The principle used to design the optimal policy will be generalized to obtain Algorithm 1.

Dynamic programming algorithm to compute the optimal expected number of tasks completed within the budget b on a single processor without preemption.
4.1.2. With two processors
We consider the following policy: (i) we start two tasks in parallel; (ii) if none of them completes by time 2, we let them run up to time 3; (iii) otherwise, we kill at time 2 any not-yet completed task and start a new task instead. The following case analysis displays the expected number of completed tasks for each case of execution time of the two tasks initially started:
For instance, the square at the intersection of the column w1 and the row w2 corresponds to the case where the task on the first processor completes in two units of time, where the task on the second processor would have needed 3 units of time. Because of our policy, this second task is killed and at time 2 and we have completed a single task. There remain 2 units of time and we start a third task, which will complete in this budget with probability p1. Therefore, the total expected number of completed tasks in this configuration is
The total expected number of completed tasks is
Therefore, this two-processor policy is more efficient than the optimal single processor policy! Even in the absence of deadline parallelism may help to achieve better performance.
This example helps comprehend the difficulty of the scheduling problem under study. The reader may feel frustrated that in the above example, the performance is only improved by 3%. In fact, one of the conclusions of our work is that, in the absence of deadlines, using several processors only marginally improves performance.
4.2 Complexity results
This section is the only one in the article where we allow preemption. We compare the performance of sequential scheduling, without or with preemption, to that of parallel scheduling, for the problem instance without deadline.
We first present optimal algorithms to solve in pseudo-polynomial time the sequential case without preemption (Algorithm 2) and with preemption (Algorithm 1), as well as an exponential algorithm to solve the parallel case (Algorithm 3). We then show (Lemma 4) that the performance of the first two algorithms bound the performance of the optimal parallel algorithm.

Dynamic programming algorithm to compute the optimal expected number of tasks completed within the budget b on a single processor with preemption.

Dynamic programming algorithm to compute the optimal expected number of tasks completed within the budget b in parallel.
Algorithm 1 is a dynamic programming algorithm that computes in pseudo-polynomial time the expected number of tasks that can be completed on a single processor (without preemption) for a given budget. To ease its writing (and that of Algorithm 2 for the case with preemption), we choose to present it as a recursive algorithm without memorization. Nevertheless, it can easily be transformed into a classical dynamic programming algorithm.
Lemma 1. Algorithm 1 computes the optimal expected number of tasks that can be completed on a single processor (without preemption) for a given budget b in time
Proof. The main property guiding the design of Algorithms 4.2 and 4.2 is that the only times at which knowledge is gained is when the execution time of a task reaches one of its k thresholds w1,…,wk. (Note that, by definition, a task can only complete at one of these thresholds.) Therefore, it can never be beneficial to stop a noncompleted task when its execution time is not equal to a threshold. Therefore, without loss of generality, we focus on algorithms that kill noncompleted tasks only at threshold times. Then, the only decision that such an algorithm can take is, when a task reaches a threshold without completing, whether to kill it and start a new task or continue its execution until the next threshold, where either the task will succeed or a new decision will have to be taken. This is exactly what Algorithm 4.2 encodes. This algorithm contains at most kb different calls to the function SeqSched; hence, the complexity.
Algorithm 2 is a generalization of Algorithm 1 to the case with preemption. In this context, algorithms no longer kill noncompleted tasks but can preempt them with the possibility to restart them later (or not). In the writing of this algorithm, when S is an array, the notation “
Lemma 2. Algorithm 2 computes the optimal expected number of tasks that can be completed on a single processor with preemption for a given budget b in time
Proof. The proof of correctness and optimality of Algorithm 2 both come directly from that of Algorithm 1. A task preempted at threshold s was executed for a time ws and, therefore, there can be at most
Algorithm 3 computes for parallel machines the optimal expected number of tasks that can be completed within the budget, without preemption. We call progress of a task the total execution time so far of that task. Let ParSchedDecision (
Lemma 3. Algorithm 4.2 computes the optimal expected number of tasks that can be completed on parallel processors without preemption for a given budget b in time
Proof. The proof of correctness and optimality of Algorithm 4.2 also comes from that of Algorithm 3. Any time a threshold is reached, ParSchedState is called and determines which tasks succeed or not. Then, ParSchedDecision decides which tasks to continue and whether new tasks must be started. There are at most
Relations between problems: Lemma 4 formally states that any algorithm for p processors (using or not preemption) can be simulated on a single processor with preemption. From this property, it immediately follows that the performance of the optimal parallel algorithm on p processors (Algorithm 3) is upper bounded by the performance of Algorithm 2 and lower bounded by the performance of Algorithm 1.
Lemma 4. Any algorithm designed to be executed on p processors with or without preemption can be simulated on a single processor with preemption with the same performance.
Proof. Consider any algorithm
Without loss of generality, we also assume that all thresholds are integers (otherwise, we just scale the thresholds). Then, we simulate
Note that the proof also holds if the parallel algorithm is allowed to start using some new processors in the middle of the computation or is allowed to restart a processor that it previously left idle.
Lemma 5. ParSched is never worse than SeqSched and can achieve strictly better performance on some problem instances.
Proof. Given Lemma 4, ParSched is least as good as SeqSched. A sequential execution without preemption on a single processor is a special case of a parallel execution where the number of processors is one. Thus, ParSched is at least as good as SeqSched. Now, consider the instance
Lemma 6. PSeqSched is never worse than ParSched and can achieve strictly better performance on some problem instances.
Proof. Given Lemma 4, PSeqSched is always as least as good as ParSched. Consider the instance
4.3 Asymptotic behavior
In this section, we derive an asymptotically optimal strategy when letting the budget tend to infinity. Because the scheduling strategy described below is applied independently on each processor, we can assume that
4.3.1 Optimal fixed-threshold strategy
Consider a discrete distribution
Indeed, this ratio measures the success rate per time unit, or equivalently, per budget unit (since we have unit execution speed). Formally, we would like to compute
where
Proposition 1.
Proof. Consider an execution using strategy
Note that n, nj for
and at computing its value.
When the budget b tends to infinity, so does n, because
according to the strong law of large numbers (Nelson, 1995), hence the result. We prove similarly that
Then, we have
(where
which concludes the proof.
The optimal fixed-threshold strategy
Definition 1.
To conclude this section, we work out a little example. Consider a distribution
We pick the largest of these three values to derive
4.3.2 Asymptotic optimality of
among mixed-threshold strategies
A scheduling strategy makes the following decisions for each task: when a new threshold is reached, and if the task is not successful at this point, decide whether either to continue execution until the next threshold or to interrupt the task. In the most general case, these decisions may depend upon the remaining available budget. However, when the budget is large, it makes sense to restrict to strategies where such decisions are taken independently of the remaining budget, independently to past history, and either deterministically or nondeterministically but according to some fixed probabilities. We formally define such strategies as follows:
Definition 2. A mixed-threshold strategy
Of course, the fixed-threshold strategy
Theorem 1.
Proof. Theorem 1 applies to any fixed number of processors p but recalls that we assume
and
We also prove just as before that
so that the success rate per budget unit does have the following limit when the budget tends to infinity:
The rest of the proof is pure algebra: we have to show that the maximum value of
We proceed by induction on k to show that the maximum value of the optimization problem
Assume that we have shown the result for
First case: If
Consider the distribution
Replacing
This is the desired result and concludes the analysis for the first case.
Consider the distribution
Altogether, we have solved the optimization problem
4.3.3 Asymptotic optimality of
In this section, we extend Theorem 1 to arbitrary strategies and show a much stronger result:
Theorem 2.
Proof. The proof of this theorem is quite technical and the reader may want to skip it. We deal with all scheduling strategies that never interrupt a task before it reaches its first state w1, because such strategies are obviously dominant. We define an outcome in the sample space as an infinite sequence of execution times for the tasks associated with an infinite sequence of decisions for the scheduling strategy, and we introduce the following random variables:
For any such outcome, we have
Convergence of
Thus
because
We now show that
Indeed, assume by contradiction that it is false, then
Let Ω′ be the subset of the sample space where the previous event occurs (
For any outcome,
This contradicts the previous result from the strong law of large numbers (equation (3)). Finally, we obtain:
Bounding
and
We look for an asymptotic deterministic lower bound for
which we can rewrite as
because
Indeed, assume by contradiction that it is false, then
We use a similar reasoning as before. Let
Summing up. In the previous paragraphs, we have showed that
We introduce the notation
and put together equations (5) to (7) as follows:
For any event ω,
The
Because we restricted on strategies that let tasks reach at least the first state, we have
By taking
Using the fact that
Maximum. We see that this last maximum is exactly problem
5 Continuous distributions
In this section, we build upon the previous results and deal with continuous distributions. We do assume we have a fixed budget and a deadline. Thus, in contrast to Section 4, the distribution
We start by designing several heuristics in Section 5.1 and then we assess their efficiency through experiments in Section 5.2. The code and scripts used for the simulations and the data analysis are publicly available online (Canon et al., 2018b).
5.1. Heuristics
We present below different heuristics that are frequently used to interrupt stochastic tasks. All these heuristics decide to interrupt a task when current execution time reaches some threshold related to the probability distribution. We also present O M Q O
The idea behind O
We now analyze O
In addition to the exponential and uniform distributions, Table 1 presents other standard distributions. For these distributions, we provide some code (Canon et al. (2018b)) to numerically compute the optimal time l at which tasks should be interrupted. Note that there exist many relations between probability distributions. For instance, the beta distribution with both shape parameters equal to one is the same as the uniform distribution, whereas it has a U-shape with both equal to 0.5 and a bell shape with both equal to 2. Also, the exponential distribution is a special case of the gamma and Weibull distributions when their shape parameter is one.
Probability distributions with their PDF and density graph.a
PDF: probability distribution function.
aSupports are
Figure 1 shows how

Efficiency (ratio
We remark that the lognormal distribution, which presents a fast increase followed by a slow decrease with an heavy tail, exhibits an optimal cutting threshold during the execution of a task: on Figure 1, we see that the optimal threshold is
Finally, we observe that three distributions are the most efficient when the cutting threshold tends to zero (
5.2 Experiments
The following experiments make use of three standard distributions: exponential, uniform, and lognormal. The first two distributions are very simple and easy to use, while the latter has been advocated to model file sizes (Feitelson, 2014), and we assume that task costs could naturally obey this distribution too. Moreover, the lognormal distribution is positive, it has a tail that extends to infinity and the logarithm of the data values are normally distributed. Also, this distribution leads to a nontrivial cutting threshold, contrarily to exponential (interrupt anywhere) or uniform (never interrupt), thereby allowing for a complete assessment of our approach. In all experiments, we submit tasks steadily until the budget and/or the deadline is exhausted.
Figure 2 shows the number of successfully executed tasks for each heuristic with three distributions (lognormal, uniform, exponential) of same expected value

Number of successfully executed tasks for each heuristic with three distributions (lognormal, uniform, exponential) of same expected value
Next, we focus on the lognormal distribution. First, in Figure 3, we assess the impact of three important parameters: the standard deviation, the budget, and the deadline, respectively. The expected value is always

Number of successfully executed tasks for each heuristic, with lognormal costs and expected value
On Figure 3, we see that the higher the standard deviation, the larger the gain of every approach. With a low standard deviation, all approaches perform similarly. Increasing the budget tends to decrease the variability when running several times the same approach (the error bars are narrower with large budgets, which makes the approaches more predictable). This is a consequence of the law of large numbers. However, the expected efficiency (around 2.5 tasks per unit of time) remains similar even for a low budget of
Next, Figure 4 depicts the efficiency of O

Number of successfully executed tasks for O
Finally, recall that some distributions such as

Here

Here
Takeaway
The experiments demonstrate that O
6 Conclusions
This article deals with scheduling strategies to successfully execute the maximum number of a bag of stochastic tasks on VMs with a finite budget and under a deadline constraint. We first focused on the problem instance with discrete probability distributions and no deadline. We proposed three optimal dynamic programming algorithms for different scenarios, depending upon whether tasks may be preempted or not and whether multiple VMs may be enrolled or only a single one. We also introduced an asymptotically optimal method that computes a cutting threshold that is independent of the remaining budget. Then, we extended this approach to the continuous case and with deadline. We designed O
Future work will be dedicated to considering heterogeneous tasks (still with stochastic costs), as well as heterogeneous VMs. Typically, cloud providers provide a few different categories of VM with different computer powers and nominal costs, and it would be interesting (albeit challenging) to extend our study to such a framework. Another interesting direction would be to take into account start-up costs when launching a VM, thereby reducing the amount of parallelism, because fewer VMs will likely be deployed.
Footnotes
Acknowledgements
The authors would like to thank the anonymous reviewers for their valuable comments and suggestions, which helped improve the quality of this article. A shorter version of this work has been published in the proceedings of SBAC-PAD’18 (Canon et al., 2018a).
Declaration of Conflicting Interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
