10

Click here to load reader

Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

Embed Size (px)

Citation preview

Page 1: Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

Performance Analysis of EDF Schedulingin a Multi-Priority Preemptive

M/G/1 QueueVidura Gamini Abhaya, Zahir Tari, Member, IEEE, Panlop Zeephongsekul,

and Albert Y. Zomaya, Fellow, IEEE

Abstract—This paper presents a queueing theoretic performance model for a multipriority preemptive M=G=1=:=EDF system.Existing models on EDF scheduling consider them to be M=M=1 queues or nonpreemptive M=G=1 queues. The proposed modelapproximates the mean waiting time for a given class based on the higher and lower priority tasks receiving service prior to the targetand the mean residual service time experienced. Additional time caused by preemptions is estimated as part of mean requestcompletion time for a given class and as part of the mean delay experienced due to jobs in execution, on an arrival. The model isevaluated analytically and by simulation. Results confirm its accuracy, with the difference being a factor of two on average in highloads. Comparisons with other algorithms (such as First-Come-First-Served, Round-Robin and Nonpreemptive Priority Ordered)reveal that EDF achieves a better balance among priority classes where high priority requests are favored while preventing lowerpriority requests from overstarvation. EDF achieves best waiting times for higher priorities in lower to moderate loads (0.2-0.6)and while only being 6.5 times more than static priority algorithms in high loads (0.9). However, for the lowest priority classes, itachieves comparable waiting times to Round-Robin and First-Come-First-Served in low to moderate loads and achieves waitingtimes only twice the amount of Round-Robin in high system loads.

Index Terms—Queueing systems, preemptive, earliest deadline first, real-time, scheduling, M/G/1

Ç

1 INTRODUCTION

PRIORITY scheduling is a popular technique to achievedifferentiated service processing among multiple clas-

ses of requests. Fixed priority scheduling is widely used bysystem designers due to its simplicity in adaptation andease of implementation. It achieves differentiated serviceamong tasks in a pre-defined priority order rather thanconsidering timing constraints of tasks. While favoringhigher priority tasks, static priority scheduling algorithmstend to penalize lower priority tasks with dramaticallyincreasing waiting times [1]. Such features make themunsuitable for scheduling tasks with stringent timerequirements such as video streaming, network packetrouting and real-time systems [2], [3].

Real-time systems mandate stringent time requirementsfor their operations and as a result use specialized real-timescheduling techniques that honour processing deadlines intask execution. While such systems typically take the formof embedded or closed systems, tasks with real-timeproperties can be found in many other applications andopen systems. The pre-defined classification in static

priority scheduling makes them unsuitable for real-timetasks as they cannot dynamically adjust their schedulingstrategy to achieve task time-constraints at any given time.However, dynamic priority scheduling algorithms thatdecide priorities at runtime, are better suited in schedulingtasks with such properties. Moreover, they also address theproblem of starvation experienced by lower priority tasks,by striking a balance in service differentiation [3].

Earliest Deadline First (EDF) is such a dynamic priorityreal-time scheduling algorithm that also considers thetiming constraints of a task in scheduling them forexecution. EDF considers the processing deadlines of tasksand executes them in the increasing order of their dead-lines. In this light, the task with the earliest deadline at anygiven time has the highest priority of all. The dynamicaspect of this method stems from the fact that the task withthe earliest deadline is decided at runtime. Moreover, EDFis a better choice for systems with aperiodic and sporadictasks, and as a result it is considered as an optimal dynamicalgorithm, in the sense that no other dynamic priorityalgorithm can schedule a task set that cannot be scheduledby it [4]. EDF has been used in many systems that deal withtime sensitive data and transactions, such as in multimedia[5], video streaming [6], database systems [7], local andwide area networks [8], [9]. In our own previous work, weused EDF to schedule web service requests, to achievepredictable execution times in stand-alone and clusterbased web services middleware [10], [11], [12], [13].

Performance analysis on the use of EDF scheduling canbe found in the following works. Kargahi et al. [14] presentsa nonpreemptive M=M=m=EDF and a preemptiveM=M=1=EDF model. The work of Lehoczky et al. [15],

. V. Gamini Abhaya and Z. Tari are with the School of Computer Scienceand IT, RMIT University, Melbourne, Australia. E-mail: {vidura.abhaya,zahir.tari}@rmit.edu.au.

. P. Zeephongsekul is with the School of Maths and Geospatial Sciences,RMIT University, Melbourne, Australia. E-mail: [email protected].

. A.Y. Zomaya is with the School of Information Technologies, Universityof Sydney, Sydney, Australia. E-mail: [email protected].

Manuscript received 12 Sept. 2012; revised 30 Apr. 2013; accepted 23 June2013. Date of publication 1 July 2013; date of current version 16 July 2014.Recommended for acceptance by K. Li.For information on obtaining reprints of this article, please send e-mail to:[email protected], and reference the Digital Object Identifier below.Digital Object Identifier no. 10.1109/TPDS.2013.171

1045-9219 � 2013 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.

IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 25, NO. 8, AUGUST 2014 2149

Page 2: Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

[16] present M=M=1 and GI=M=1 models respectively. Inall of these, task arrivals are considered to be following aPoisson process and exponentially distributed service timesare considered. Moreover, the loss rate of task deadlinesare treated as the primary performance attribute. Chen et al.[17] present a nonpreemptive M=G=1=:=EDF model whichcan be considered as a better representation due to itsvalidity for general workloads. Compared to a static schemes,the EDF based model attempts to reduce the performancedegradation of lower priority request streams, with its dy-namic priority enforcements. Herein the only performanceattribute considered is the waiting time of requests.

The above works have several shortcomings. Many ofthem [14], [15], [16] consider the service times to be expo-nentially distributed. Unlike in closed or embeddedsystems, the use of EDF in open systems such as forscheduling web service requests or packet routing on theInternet where request patterns change over time and taskproperties are not known apriori. As a result, theseperformance models may not be a proper representationof such systems. The model by Chen et al. [17] is a betterrepresentation for such systems, however it has thefollowing limitations. Firstly, the model is applicable onlyfor systems that use nonpreemptive scheduling. Secondly,the waiting times of tasks has been considered as the onlyperformance parameter in their research. The deadlinemiss rate, which is an equally important indicator whenEDF is used, has not been considered.

The motivation of this research is to analyze theperformance of EDF technique in a preemptive schedulingenvironment. The main contribution of this paper is amultipriority M=G=1=:=EDF model that schedules re-quests in a preemptive-resume manner. With the proposedmodel, we show that by using preemptive scheduling thehigher priority requests can achieve better waiting timesand improve on the deadline loss rates compared to usingnonpreemptive scheduling, whilst not overpenalizinglower priority requests. To the best of our knowledge, theproposed model is the only one of its kind that represents apreemptive M=G=1 system using EDF policy.

The proposed model is achieved by extending the workof Chen et al. [17]. It supports an arbitrary number ofrequest classes where their priorities are governed by thedeadline offset assigned. A lower deadline offset signifies ahigher priority. The model is an approximation of the meanwaiting time experienced by a request belonging to aparticular priority class. The mean waiting time is definedbased on the following four estimates. The time resulted bythe execution of the portion of higher priority requestsalready found in the system by a newly arrived requestbelonging to the target priority class, and receive serviceprior to the target, the portion of lower priority requestsalready found in the system by the target request andreceive service prior to the target, the portion of higherpriority requests arriving at the system after the targetrequest and receive service prior to the target and the meantime delay experienced by the target request as a result ofjobs in execution at the time of arrival. The portions ofrequests for the first three parameters mentioned for everypriority class are estimated based on the deadline differencebetween each of the priority classes and the target class.

The preemptions and their effect on the waiting time areestimated by defining it to be part of the mean delayincurred by the jobs in execution, at an arrival. This isachieved by introducing a definition for the mean comple-tion time of a request which is defined as the sum of itsmean service time and the time incurred by any preemp-tions. The additional time incurred by the preemptions areestimated using Little’s law [18] and two cases areconsidered based on how the deadline differences compareagainst the mean completion time. The mean completiontime of the system is incorporated into the mean delayincurred by the executions at an arrival. It is estimatedbased on the probability of a request from a particularpriority, be found in service by an arrival.

Existing applications that use priority based schedulingcould make use of preemptive EDF technique to achievea better balance between the waiting times experiencedbetween higher and lower priority tasks, to prevent lowerpriority tasks being overpenalized. Applications such asvideo streaming and network packet routing that aretime sensitive could benefit from the deadline-based natureof the algorithm. However, the technique could be used onany server that carries out differentiated request processing.The proposed model with support for any service-time dis-tribution, makes it highly effective with applications such asweb services and cloud platforms in their current trendtowards multitenant architectures. Multitenancy shares thesame software and hardware across multiple tenants whiledifferentiating service among their operations.

The rest of the paper is organized as follows. Itcomprises of this main file and supporting supplementaryfile which is available in the Computer Society DigitalLibrary at http://doi.ieeecomputersociety.org/10.1109/171.The supplementary file contents available online are orga-nized as continuations of sections in the main file. Readersmust start with the main file and refer to the correspondingsupplementary section mentioned, where applicable. At theend of the supplementary file section available online, readersmust switch to the next section in the main file. First somebackground and related work on priority based performancemodels is presented in Section 2. It is followed by the pro-posed model presented in Section 3. A theoretical analysis ofthe model is presented in Section 2 of the supplementary fileavailable online, followed by an empirical evaluation inSection 5. Finally a Conclusion is provided in Section 6.

2 BACKGROUND AND RELATED WORK

Prior to presenting the proposed model, we discuss someof the related work in this area and the necessary back-ground that the model is based upon. Many previousattempts at using deadline based scheduling to differenti-ate service processing can be found in literature. A detaileddiscussion on these can be found in Section 1 of the ac-companying supplementary file provided available online.The most relevant work that acts as the background towhich the contribution is based upon, is discussed withinthe section. It is suggested that this section in the supple-mentary file available online be referred to, for betterunderstanding of the model presented in the followingsection.

IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 25, NO. 8, AUGUST 20142150

Page 3: Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

3 THE PROPOSED MODEL

This section presents the model to evaluate the perfor-mance of a multiclass M=G=1 deadline based schedulingsystem. The evaluation focuses on mean waiting time ofmultiple streams of requests being serviced by a singleserver. As the proposed model is based on the work by [17],the same system configuration is followed. Each requeststream has its own deadline and the requests are servicedand queued in the order of their increasing deadlines. Weuse the terms job and task synonymously to refer to arequest that needs to be serviced and the term class andstream synonymously to refer to a request stream. Althoughrequest arrivals could be characterized in various ways, weconsider request streams with Poisson arrival schemes. APoisson process is considered to be a good approximationof real world systems with large number of independentevents, which have no memory of each other [19]. More-over, many classical work [20], [21] indicate that mostrequest streams characterized by different distributionswould over time converge to a Poisson distribution, whenthe system settles down.

The system has N number of independent streamsthrough which requests arrive at the system followinga Poisson process, where each stream is identified by i,i ¼ 1; 2; . . .N . Each stream is associated with a differentdeadline and all requests from the same stream getsassigned a constant deadline offset. For instance, a requestfrom stream i arriving at the system at time t will have adeadline offset of tþ di where di is a constant for stream i.The priority of a stream is decided by the associateddeadline offset where stream j, if i G j) di � dj. Moreoverthe difference between deadline offsets of two streams aredenoted by Dj;i ¼ dj � di. Scheduling of jobs amongdifferent input streams uses EDF and jobs originatingfrom the same stream are treated in a First-Come-First-Served basis. Table 1 contains the symbols and notationsused in the text in describing the proposed model.

We derive the proposed model in two parts. Firstly, wederive an initial overall equation for the system thatidentifies the parameters based on equation (2) presentedin Background section (in the Supplementary file availableonline. Secondly, we approximate the time incurred bypreemptions as part of the definition for mean time delay

experienced by a priority class, due to the jobs currently inexecution and it is presented separately. We estimate theparameters Nj;i and Mj;i based on absolute deadlinesconsidered by EDF scheduling and W0 will be estimatedsuitably for a preemptive-resume system.

3.1 Deriving Equations for Case N ¼ 2

We consider the simplest scenario of having two requeststreams where N ¼ 2 and observe the following on itsbehaviour. We consider stream 1 to have a higher prioritythan stream 2 as requests from stream 1 have shorter deadlinesthan requests from stream 2, (i.e. tþ d1 G tþ d2). In a typicalpriority based system that uses Head-of-line queueingdiscipline [18], higher priority tasks are always serviced aheadof lower priority tasks. Given that the priority is determinedby the absolute deadline in the system under consideration,EDF scheme allows the processing of a portion of requestsfrom stream 2 ahead of a newly arrived request from stream 1.

First, we consider the viewpoint of a tagged requestbelonging to stream 1:

. All requests belonging to stream 1 found in thequeue by the tagged request upon its arrival at thesystem, will be serviced prior to the tagged request.Requests from stream 1 arriving at the system afterthe tagged request will be served later. Therefore,N1;1 ¼ �1W1 and M1;1 ¼ 0.

. Requests from stream 2 that are already present inthe queue may have absolute deadlines that areprior to the absolute deadline of the tagged request.While there will be on average �2W2 requests fromstream 2 already present in the queue, only requestsarriving at leastD2;1 time before and still in the queueafter D2;1 time, will receive service prior to thetagged request. Fig. 1 illustrates this scenario.Consider I to be the tagged request from stream 1.Out of all stream 2 requests already in the queue,request J is the one with the latest absolute deadlinethat gets service prior to the tagged request. There-fore, a request from stream 2 to be serviced prior totagged, must have arrived at the system at least D2;1

time units before the tagged request and havewaited in the queue D2;1 amount of time. Consideringthis, N2;1 ¼ maxð0; �2ðW2 �D2;1ÞÞ can be estimated.

TABLE 1Symbols and Notations Used in the Proposed Model

GAMINI ABHAYA ET AL.: EDF SCHEDULING IN MULTI-PRIORITY PREEMPTIVE M/G/1 QUEUE 2151

Page 4: Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

. Due to the difference in the deadline offsets d1 G d2

requests from stream 2 arriving at the system afterthe tagged request will be executed after the tagged.Hence, M2;1 ¼ 0.

Next we consider the viewpoint of the tagged requestfrom stream 2:

. Due to the difference in the deadline offsets d1 G d2

stream 1 requests already present in the queue whenthe tagged request arrives at the system, will beserviced prior to the tagged. Therefore, N1;2 ¼ �1W1.

. Once the tagged request arrives at the system, a portionof the stream 1 requests arriving subsequently at thesystem will have deadlines earlier than the taggedrequest. With reference to Fig. 1, if the request J is thetagged request, I can be considered as the last stream 1request that arrive thereafter and receive service priorto the tagged. Any stream 1 requests that arrive at thesystem after the tagged request no later than D2;1, willreceive service prior to the tagged. However, given thewaiting time of stream 2, the tagged request maybe inthe queue for a time period less than D2;1, given thatW2 G D2;1. Considering these, it can be estimated thatM1;2 ¼ �1 minðW2;D2;1Þ.

. Due to the constant deadline offset of a requeststream, all of the already queued requests fromstream 2 will be executed prior to the tagged re-quest. Similarly, requests from the same streamarriving at the system after the tagged request willhave an absolute deadline that is later than thetagged. Hence, all such requests will only beserviced after the tagged request. Therefore, it canbe easily concluded that N2;2 ¼ �2W2 and M2;2 ¼ 0.

Next, we substitute these estimates directly in equation (2)presented in Background Section (Supplementary fileavailable online) and receive the following two equationsthat estimates the waiting times for streams 1 and 2:

W1 ¼W0 þX1�1W1 þX1max 0; �2ðW2 �D2;1Þ� �

¼W0 þ �1W1 þ �2max 0; ðW2 �D2;1Þ� �

W2 ¼W0 þX1�1W1 þX2�2W2 þX1�1minðW2; D2;1Þ¼W0 þ �1W1 þ �2W2 þ �1minðW2; D2;1Þ:

3.2 Deriving the Generic EquationParts of the two equations we achieved above can be gen-eralized for the case of more than two streams. The

reasoning provided for obtaining the two equations standsthe same for any number of levels or equations. Theequation for the waiting time of each request stream ismade up of four distinct parts. The mean residual servicetime represented by W0 is common to all request streams.The remaining three parts can be generalized for the rest ofrequest streams, from the view point of a tagged requestfrom stream i.

From the earlier discussion we can conclude that allrequests from higher priority streams that arrive prior tothe tagged request will receive service before the taggedrequest. We could generalize the number of such requestsas follows,

Nk;i ¼ �kWk 1 � k � i:

A portion of requests from lower priority streams thatarrive at the system prior to the tagged request, will receiveservice prior to the tagged due to the earlier deadlines theyposses. The number of such requests can be estimated forany request stream with the following,

Nk;i ¼ �k maxð0;Wk �Dk;iÞ i G k � N:

The remaining part of the equation is the representationof requests from higher priority streams that arrive at thesystem after the tagged request and receive service beforethe tagged request, due to the earlier deadlines they posses.This number could be estimated with the following,

Mk;i ¼ �k minðWi;Di;kÞ 1 � k G i:

In turn these generic terms could be used in equation 2presented in Background section (Supplementary fileavailable online) to arrive at the generic equation for thewaiting time of any stream i.

Wi ¼W0i þXik¼1

�kWk þXNk¼iþ1

�k maxð0;Wk �Dk;iÞ

þXi�1

k¼1

�k minðWi;Di;kÞ: (3)

The term W0 has been replaced by W0i

as the systemunder consideration is a preemptive resume system. W0

iis

the mean residual service time of the system for the i thpriority. Herein, only residual service times of streams 1 toi are considered as only a higher priority request (k where1 � k G i) may preempt a request (of stream i) in execution.

3.3 Estimation of the Mean Delay Incurred by Jobsin Execution

In equation (3), W0i

represents the mean delay incurred bythe jobs in execution, at an arrival. While this estimation isstraightforward [18] in a nonpreemptive system, a pre-emptive scheduling system tends to be more complex.Herein, we consider the system to be preemptive resumewhere a request of lower priority in execution may be pre-empted by a newly arrived request with a higher priority andresumed execution later. With EDF scheduling, the priority ofa request is decided at runtime by its absolute deadline, suchthat the request with the highest priority is the one with theearliest deadline, at any given time.

Fig. 1. Deadline difference between requests.

IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 25, NO. 8, AUGUST 20142152

Page 5: Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

For such a M=G=1=:=EDF system we derive the meanresidual service time as follows. We define the randomvariable Ci as the mean time required to complete servicefor a request from stream i, including the time the request ispreempted. During an average service completion intervalof a stream i request, the mean number of stream j jobs(where stream j is of higher priority and can preempt aclass i job in execution) that arrive at the system can beestimated as �jCi. If all such class j requests preempt theclass i request in service and execute until completion, Cicould be defined as

Ci ¼ Xi þXi�1

j¼1

ð�jCiXjÞ: (4)

The execution of a request may happen in a staggeredmanner due to preemptions that take place. Recall that theuse of EDF scheduling enforces the priorities dynamicallyat runtime based on absolute deadlines. As such, only aportion of class j requests are able to preempt an alreadyexecuting class i request. Therefore, a request from stream jwill be faced with the following two conditions for apreemption to happen. As illustrated in Fig. 2, it is possiblefor a request to complete execution with preemptionswithin the time period Di;j ¼ ðdi � djÞ. In this instance,tasks with earlier deadlines (compared to the stream i taskin execution) that arrive within the time period ðDi;j � CiÞwill not result in the preemption of request i, as it hasalready completed execution.

Fig. 3 illustrates a scenario where the staggered execu-tion of the request from stream i continuing beyond thetime period Di;j. In this instance, tasks from stream jarriving within the period Ci, but beyond Di;j would notresult in any preemptions, as their absolute deadlineswould be later than that of the task in execution at the time.Therefore, we could assume that the preemption of arequest in execution from stream i would only take placewithin the least of Ci and Di;j for any given i and j.

Considering the mentioned scenario, Equation (4) forthe completion time for a class i request, could be modifiedas follows:

Ci ¼Xi þXi�1

j¼1

�j minðDi;j; CiÞXj

� �

Ci ¼Xi þXi�1

j¼1

�j minðDi;j; CiÞ� �

: (5)

Let j� ¼ subscript j ¼ 1; 2; . . . i� 1 such that Di;j � Ci.Let j0 ¼ subscript j ¼ 1; 2; . . . i� 1 such that Di;j 9 Ci

Ci ¼Xi þXj�ð�j�Di;j� Þ þ

Xj0ð�j0CiÞ

Ci 1�Xj0�j0

!¼Xi þ

Xj�ð�j�Di;j� Þ

Ci ¼Xi þ

Pj� ð�j�Di;j� Þ

ð1�P

j0 �j0 Þ: (6)

Let Pi be the probably of a request from stream i being inservice at an arrival. Pi could be defined as:

Pi ¼ �iCi: (7)

Substituting (6) in (7) we obtain,

Pi ¼�iXi þ

Pj� ð�j0Di;j� Þ

ð1�P

j0 �j0 Þ

!

¼�i þ

Pj� ð�j0Di;j� Þ�i

ð1�P

j0 �j0 Þ: (8)

The mean delay experienced by a new arrival from thejobs already in execution, can be defined as the sum of allprobabilities of a job of a given class is in service, times themean residual service time for the given class [22].Therefore, we could define W0

i

W0i ¼

Xik¼1

ðPkRkÞ: (9)

Substituting (8) in (9),

W0i ¼

Xik¼1

Rk

�i þP

j� ð�j0Di;j� Þ�ið1�

Pj0 �j0 Þ

!(10)

where Ri ¼ Xi2=2Xi for an M=G=1 system [18]. Note that

when the two extreme cases are considered,

If Ci � Di;j 8j;

then; W0i ¼

Xik¼1

Ri�i

ð1�P

j �jÞ

!

and if Ci 9 Di;j 8j

then; W0i ¼

Xik¼1

Ri �i þXj

ð�jDi;jÞ�i

!:

Fig. 2. Request completing execution within Di;j. Fig. 3. Request completing execution beyond Di;j.

GAMINI ABHAYA ET AL.: EDF SCHEDULING IN MULTI-PRIORITY PREEMPTIVE M/G/1 QUEUE 2153

Page 6: Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

In conclusion, the following generic expression esti-mates the mean waiting time for a given class i in aM=G=1=:=EDF system

Wi ¼W0i þXik¼1

�kWk þXNk¼iþ1

�k maxð0;Wk �Dk;iÞ

þXi�1

k¼1

�k minðWi;Di;kÞ: (11)

Given the preemptive resume scheduling disciplineconsidered, the mean waiting times must satisfy theconservation law for preemptive resume M=G=1 queues[18], [23]

Xik¼1

�kWk ¼�iW0

i

1� �i(12)

where �i ¼Pi

k¼1 �k. The waiting time for each priority levelcould be estimated by using equation (11) and solving theresultant set of nonlinear equations under the constraintgiven by equation (12).

4 THEORETICAL PROOF

Please refer Section 2 of the supplementary file availableonline for a theoretical proof of the proposed model.

5 EMPIRICAL EVALUATION

The evaluation of the proposed model was carried outusing direct substitution (analytical) and comparing it witha simulated version of the scenario using Omnett++ [24], adiscrete event simulator.

The main metric measured and used for comparisonsbetween the two methods is the mean waiting time for eachpriority class and for the overall system. As a secondaryparameter, we also measured the deadline miss ratereported for each priority class. We consider systemswith 2 priority classes upto a maximum of 5 priorities forbrevity. Each system was tested for five load conditions.We considered the system load � G 1 to be 0.3 for lowestand 0.9 as the highest. The total load is divided amongst the

priority classes in the reverse order so that the lowestnumbered priority class is responsible for the highest loadand in turn has the highest priority in the system. Forinstance, a 3 priority level system with 0.6 as the systemload will have load distributed in a 3: 2: 1 ratio �1 ¼ 0:3,�2 ¼ 0:2 and �3 ¼ 0:1. As our estimate is independent ofthe service distribution, we use uniformly distributedservice times for most cases. Furthermore, we also useexponentially distributed service times for some of thesimulations to analyze the estimates for different servicetime distributions.

Arrival rates are calculated based on the load and meanservice times ð�i ¼ �i

XiÞ. Deadlines were picked considering

the maximum service time values possible for each priorityclass. Performance measures on each simulation were adata set of 50,000 requests. Simulations involved a warm-up period of 10,000 to let the system arrive at a steady stateprior to collection of data and a cool-down period of 5000requests to ensure the measurements were not influencedby such phenomenon [25].

5.1 Analytical ResultsAs the system is modelled as a priority based preemptiveresume M=G=1=:=EDF system, the following characteris-tics were expected from the waiting time estimatesobtained from the model. The system represented by theproposed model favors shorter deadlines and considersthem to be higher priority enabling them to have shorterwaiting times over other requests in the system. However,with deadlines being the deciding factor ensures that lowerpriority classes does not starve, as in the case of traditionalstatic priority based preemptive systems.

Fig. 4 contains plots of the estimated waiting times for 2systems with the number of priority classes being 3 and 4.The estimates for each class follows the intended behaviourof shorter waiting times for higher priority and longerwaiting times for lower priority classes. Moreover, thedifference in waiting times between priorities gets largerwith the total load in the system. At higher loads, lowerpriority requests have to wait longer for processingresources. The difference in arrival rates between theclasses is the cause for this behaviour.

Fig. 4. Analytical results-uniformly distributed service times.

IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 25, NO. 8, AUGUST 20142154

Page 7: Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

5.2 Distribution Independence EvaluationModelling a system as an M=G=1 queue allows theperformance model to support arbitrary service times.The expectation is the system exhibits similar behaviour forany type of service time distribution. As such the proposedmodel is evaluated next for exponentially distributedservice times. Fig. 5 illustrates the estimates arrived at,using the model.

As depicted in Fig. 5, the higher priority classes (withshorter deadlines) have lower waiting times compared tothe lower priority classes (with longer deadlines). More-over, it can be observed that lower priority classes areestimated to have longer waiting times and be penalizedmore as the load increase. Comparing these trends withFig. 4, it can be concluded that the model predicts similarpatterns for both service time distributions, therebyconfirming its validity for any service time distribution.

5.3 Analytical vs. Simulation Results ComparisonNext the proposed model is evaluated for its accuracy ofestimation of a real priority based preemptive schedulingsystem with M=G=1=:=EDF properties. For this, wecompare the analytical results we obtained from valuesubstitution, with the results obtained from simulationruns using Omnet++. Fig. 6 contains comparisons ofwaiting times for scenarios from 2-5 priority classes. Bothanalytical and simulation results exhibit the same trends inwaiting times for each priority class, which confirms thatthe model is indeed valid for any service time distribution.

With the priority based model, the goal is to favor higherpriority requests thereby reducing their waiting times forprocessing resources. As the proposed model follows theconservation laws for a priority based preemptive schedulingsystem [18], [23], work is neither created nor lost. Accord-ingly, favoring higher priority classes end up increasing thewaiting times of lower priority classes. This is clearly visiblefrom both analytical and simulation results obtained.

It can be observed that the difference between analyticaland simulation results is smaller in lower load conditionsand the difference increases over higher loads. Simulationresults suggest that lower priority classes are penalized lessthan the estimate given by the model.

Please refer to Section 3 of the supplementary fileavailable online for the remaining evaluations prior to thefollowing Discussion.

5.4 DiscussionThe proposed priority based preemptive M=G=1=:=EDFmodel was evaluated in many categories. The evaluationconfirmed that irrespective of the number of prioritiespresent in the system, the resultant mean waiting timesfollow a similar pattern thus far confirming the validity ofthe model for any number of priority classes.

The proposed model considers the method of schedulingto be independent of the service times used. To evaluatethis aspect, we used a configuration with exponentiallydistributed service times on the model and measured themean waiting times for different load conditions and priorityclass counts. However, the mean waiting times obtainedfollowed a similar pattern for both uniformly and exponen-tially distributed service times, thereby confirming that themodel certainly supports any service time distribution.

Thereafter we compared the analytical results obtainedwith the actual waiting times recorded by a simulated systemunder various traffic and load conditions. These evaluationswere conducted with the view of measuring the accuracy ofwaiting times given by the model. In these evaluations, it wasobserved that there was a difference between the analyticaland simulation results and the difference becomes significantwith increasing system load. Moreover, the increase ofwaiting times with load, for each priority class is much largerin high load conditions. Note that the proposed model is amathematical approximation of the actual system and itprovides estimates based on statistical parameters. Therefore,differences in the estimates and the actual times recorded, areto be expected.

In the next set of evaluations we compared the proposedmodel with the nonpreemptive M=G=1=:=EDF model webased our theoretical proof on. These were conducted tojustify the performance gain we achieve by using preemp-tive scheduling instead of being nonpreemptive. Ourcomparisons revealed that a preemptive model favorshigher priority requests, thereby achieving comparativelyshorter waiting times than the nonpreemptive model. The

Fig. 5. Analytical results-exponentially distributed service times.

GAMINI ABHAYA ET AL.: EDF SCHEDULING IN MULTI-PRIORITY PREEMPTIVE M/G/1 QUEUE 2155

Page 8: Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

ability for a higher priority request to immediately seize theprocessing resources upon its arrival at the system and bypreemption even when a lower priority task is in execution,confirms this behaviour. However, due to the conservativenature of the proposed model, lower priority requestsexperience comparatively longer waiting times than in anonpreemptive model.

Thereafter, we compared the two systems for theirresultant deadline miss rates. As the preemptive EDFscheduling results in lower waiting times for higherpriority requests, it also results in comparatively lowerdeadline miss rates for higher priority requests. On thecontrary, nonpreemptive EDF scheduling results in lessnumber of deadline misses for lower priority requestscomparatively. The favoring of higher priority requests bythe preemptive scheduler ensures that their waiting timefor processing resources is less than nonpreemptivescheduling. This allows more higher priority requests tocomplete within the designated processing deadlines. Onthe contrary, the nonpreemptive scheduler ensures that theexecution of a lower priority request is not interruptedeven when a newly arrived request has an earlier deadline.Thereby, it results in comparatively better waiting times forlower priority requests and a lower deadline miss rate.However, when the miss rates recorded by the overallsystem is taken into consideration, the preemptive EDF

scheduler performs better in achieving the least overallmiss rate among the two.

To evaluate the performance of the EDF based schedul-ing implemented with a M=G=1= queue on a systemwith soft deadlines, we compared it with FCFS, RR andNonpreemptive PRO algorithms. The nondifferentiatingnature of the FCFS and RR algorithms, were demonstratedin the similar waiting times they achieve for all priorityclasses. The PRO algorithm follows a static priority scheme,resulting in better waiting times for higher priority requestsespecially in high load conditions. However, it records thelongest waiting times for the lower priority classes andpenalizes them more on higher load conditions. While theM=G=1=:=EDF system also follows the priority model, itenforces them dynamically based on absolute deadlineswhere a request from a lower priority class can be the requestwith the earliest deadline thereby having the highest priorityat a given time. Such behaviour favors the higher priorityclasses while preventing lower priority classes from overstarvation. Moreover, the deadline miss rates recorded byeach algorithm indicates that algorithms such as FCFS andRR result in a high percentage of deadline misses, despitethe lower waiting times they record at times. From theresults, we could conclude that explicitly scheduling basedon a deadline will give systems a better chance of meetingtheir processing deadlines and QoS guarantees.

Fig. 6. Comparison of analytical and simulation results.

IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 25, NO. 8, AUGUST 20142156

Page 9: Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

For systems such as web services and cloud middlewarethat are increasingly moving towards multitenancy, it is amust to achieve the right balance between the differenttenants, their clients and request types. From the evalua-tions presented, it can be concluded that deadline basedscheduling could be used in them to achieve the rightbalance between such parameters. As shown by our model,the service time independent nature of the schedulingtechnique makes it usable with any type of requests.Moreover, the use of deadlines enable the modifying thepriority levels of requests on-the-fly, thereby enabling morecontrol on how requests are executed at runtime. Suchfeatures will enable service providers with zero downtimechanges to the scheduling discipline of the system. Anempirical evaluation of EDF scheduling in a real imple-mentation (using web services middleware as the target)can be found in our previous work [10], [11], [12], [13].

5.5 Difference Between Analytical andSimulation Results

A possibility for the discrepancy of analytical and simula-tion results is in the estimation of mean delay incurred bytasks in execution at an arrival, given by equation (9). In theestimation, the calculation was based on the probability offinding a task belonging to class 1 to i in execution. This isconsidered due to classes iþ 1 to N having larger deadlineoffsets, being treated as low priority. Although thiscondition holds true theoretically, a newly arrived taskfrom stream i in an actual system using EDF scheduling,could find a task belonging to class j ¼ ðiþ 1Þ . . .N inexecution and not preempt it due to absolute deadlineconsiderations. A task belonging to stream j ¼ ðiþ 1Þ . . .Nthat arrives at least Dj;i time units prior to the aforemen-tioned request from stream i will be in execution at itsarrival and will not be preempted by it.

An observation made in Fig. 6, is the difference between thetwo results increasing with the system load. The differencesbecome quite significant for higher loads. Upon analysing thesimulations it was found that many tasks miss their deadlinesin the high load conditions. This is clearly visible from the missrates for the simulations that were presented in Table 2(Supplementary file available online) under PreemptiveM=G=1=:=EDF . Deadline misses lead to execution ofrequests getting longer, thereby having an impact on themean service completion timeCi and in turn the mean delayincurred by the requests in execution Wi

0. For instance, astream i request arriving at the system may find a task fromstream j ¼ ðiþ 1Þ . . .N already in execution. The newlyarrived stream i request may not be able to preempt thestream j request due to it having an earlier deadline despitehaving missed it. Although the proposed model has thisas a parameter, it does not contain a representation fordeadline misses or the impact it may have on Ci and on Wi

0.Each of these observations contribute to the discrepancy

between analytical and simulation results. Given thecomplex nature of the system, it is difficult to modify themodel and consolidate these differences to get the valuescloser. However, both groups of results display the samecharacteristics despite the differences in actual values.Therefore, we could conclude that the model presented isan acceptable approximation of a M=G=1=:=EDF system.

6 CONCLUSION

This paper presented a multipriority based preemptiveresume M=G=1=:=EDF queue where the priority orderingis governed by the execution deadlines. The performancemetric of concern was the mean waiting time experiencedby requests belong to each priority class. The goal of usingEDF in a preemptive scheduling system is to ensure thathigher priority requests are favored and they experiencelower mean waiting times, without leading lower priorityrequests to overstarvation. Analytical and simulationresults obtained for the model confirms that such a balancebetween the priority classes can indeed be achieved withthe use of EDF with preemptive scheduling. Therefore, weconcluded that EDF would be a better choice for systemswhere differentiated request processing between multipleclasses is required, yet a balanced approach where lowerpriority requests are prevented from overstarvation, isconsidered important. Moreover, being a solution that isvalid for any service time distribution, the model is validfor any system that uses EDF scheduling.

REFERENCES

[1] K. Chen and L. Decreusefond, ‘‘An Approximate Analysis ofWaiting Time in Multi-Classes M/G/1/./EDF Queues,’’ Netw.Dept., Ecole Nat. Superieure Telecommun., Paris, France, Tech.Rep., 1997.

[2] D. Levine, C. Gill, and D. Schmidt, ‘‘Dynamic SchedulingStrategies for Avionics Mission Computing,’’ in Proc. AIAA/IEEE/SAE 17th DASC, 1998, vol. 1, pp. C15/1-C15/8.

[3] M. Hamdaoui and P. Ramanathan, ‘‘A Dynamic PriorityAssignment Technique for Streams With (m, k)-Firm Deadlines,’’IEEE Trans. Comput., vol. 44, no. 12, pp. 1443-1451, Dec. 1995.

[4] J.A. Stankovic, M. Spuri, K. Ramamritham, and G.C. Buttazzo,Deadline Scheduling for Real-Time Systems: EDF and Related Algorithms,J.A. Stankovic, Ed. Boston, MA, USA: Kluwer, 1998.

[5] A. Narasimha Reddy and J. Wyllie, ‘‘I/O Issues in a MultimediaSystem,’’ Computer, vol. 27, no. 3, pp. 69-74, Mar. 1994.

[6] J. Sohn and G. Kim, ‘‘Earliest-Deadline-First Scheduling onNonpreemptive Real-Time Threads for a Continuous Media Server,’’in High-Performance Computing and Networking. New York, NY,USA: Springer, 1997, pp. 950-956.

[7] R. Abbott and H. Garcia-Molina, ‘‘Scheduling Real-Time Trans-actions: A Performance Evaluation,’’ ACM Trans. Database Syst.,vol. 17, no. 3, pp. 513-560, Sept. 1992.

[8] D. Liu and Y. Lee, ‘‘An Efficient Scheduling Discipline for PacketSwitching Networks Using Earliest Deadline First Round Robin,’’Telecommun. Syst., vol. 28, no. 3, pp. 453-474, Mar. 2005.

[9] H. Schulzrinne, J. Kurose, and D. Towsley, ‘‘An Evaluation ofScheduling Mechanisms for Providing Best-Effort Real-TimeCommunications in Wide-Area Networks,’’ in Proc. IEEE 13thINFOCOM, 1994, pp. 1352-1361.

[10] V. Gamini Abhaya, Z. Tari, and P. Bertok. (2012, Sept.). BuildingWeb Services Middleware with Predictable Execution Times. WorldWide Web [Online]. 15(5/6), pp. 685-744, 10.1007/s11280-012-0160-x.Available: http://dx.doi.org/10.1007/s11280-012-0160-x.

[11] V. Gamini Abhaya, Z. Tari, and P. Bertok, ‘‘Building WebServices Middleware with Predictable Service Execution,’’ in Proc.11th Int’l Conf. WISE, Hong Kong, China, Dec. 2010, vol. 6488,p. 23, Springer-Verlag: New York, NY, USA.

[12] V. Gamini Abhaya, Z. Tari, and P. Bertok, ‘‘Achieving Predict-ability and Service Differentiation in Web Services,’’ in Proc. 7thICSOC-ServiceWave, 2009, pp. 364-372.

[13] V. Gamini Abhaya, Z. Tari, and P. Bertok, ‘‘Using Real-TimeScheduling Principles in Web Service Clusters to AchievePredictability of Service Execution,’’ in Proc. 8th ICSOC,San Francisco, CA, USA, Dec. 2010, pp. 197-212.

[14] M. Kargahi and A. Movaghar, ‘‘A Method for PerformanceAnalysis of Earliest-Deadline-First Scheduling Policy,’’ J. Super-comput., vol. 37, no. 2, pp. 197-222, Aug. 2006.

GAMINI ABHAYA ET AL.: EDF SCHEDULING IN MULTI-PRIORITY PREEMPTIVE M/G/1 QUEUE 2157

Page 10: Performance Analysis of EDF Scheduling in a Multi-Priority Preemptive M/G/1 Queue

[15] J. Lehoczky, ‘‘Real-Time Queueing Theory,’’ in Proc. 17th IEEEReal-Time Syst. Symp., 1996, pp. 186-195.

[16] J. Lehoczky, ‘‘Using Real-Time Queueing Theory to ControlLateness in Real-Time Systems,’’ ACM SIGMETRICS Perform.Eval. Rev., vol. 25, no. 1, pp. 158-168, June 1997.

[17] K. Chen and L. Decreusefond, ‘‘An Approximate Analysis ofWaiting Time in Multi-Class M/G/1/./EDF Queues,’’ in Proc.ACM SIGMETRICS Int’l Conf. Meas. Model. Comput. Syst., 1996,pp. 190-199.

[18] L. Kleinrock, Queueing Systems Volume 2: Computer Applications.Hoboken, NJ, USA: Wiley, 1976.

[19] L. Kleinrock, Queueing Systems. Volume 1: Theory. Hoboken, NJ,USA: Wiley, 1975.

[20] Y.K. Belyaev, ‘‘Limit Theorems for Dissipative Flows,’’ TheoryProbab. Appl., vol. 8, no. 2, pp. 165-173, 1963.

[21] L. Breiman, ‘‘The Poisson Tendency in Traffic Distribution,’’Ann. Math. Stat., vol. 34, no. 1, pp. 308-311, Mar. 1963.

[22] B. Sinclair, ‘‘Priority M/G/1 Queue with and without Preemption.’’2005. [Online]. Available: http://cnx.org/content/m10820/2.3/.

[23] G. Bolch, S. Greiner, H. De Meer, and K.S. Trivedi, QueueingNetworks and Markov Chains: Modeling and Performance EvaluationWith Computer Science Applications. Hoboken, NJ, USA: Wiley, 2006.

[24] A. Varga, ‘‘The Omnet++ Discrete Event Simulation System,’’ inProc. ESM, 2001, vol. 9, pp. 319-324.

[25] P. Heidelberger, ‘‘Fast Simulation of Rare Events in Queueingand Reliability Models,’’ ACM Trans. Model. Comput. Simul., vol. 5,no. 1, pp. 43-85, Jan. 1995.

Vidura Gamini Abhaya received the BScdegree in information systems with honors fromManchester Metropolitan University, Manchester,U.K., and thePhDdegree in computer science fromRMIT University, Melbourne, Australia. Currently,he is a Research Associate with the DistributedSystems and Networking Group, School of Com-puter Science and IT at RMIT University. Hisresearch interests include Web services, distribut-edsystems,middleware, real-time systems, sched-ul ing, performance model ing, and high

performance systems. He has published many papers at reputed journals(WWWJ) and international conferences (ICSOC, WISE) and has co-authored a book onperformance onweb services. Hepossesses extensiveexperience in the industry havingpreviouslyworkedasaSoftwareArchitectand Lead Developer.

Zahir Tari received the degree in mathematicsfrom University of Science and Technology HouariBoumediene, Bab-Ezzouar, Algeria, in 1984, theMasters degree in operational research from theUniversity of Grenoble, Grenoble, France, in 1985,and the PhD degree in computer science from theUniversity of Grenoble, in 1989. He is a Professor(in distributed systems) at RMIT University, Mel-bourne, Australia. Later, he joined the DatabaseLaboratory at EPFL (Swiss Federal Institute ofTechnology, 1990-1992) and then moved to QUT

(Queensland University of Technology, 1993-1995) and RMIT (RoyalMelbourne Institute of Technology, since 1996). He is the Head of the DSN(Distributed Systems and Networking) at the School of Computer Scienceand IT, where he pursues high impact research and development incomputer science. He leads a few research groups that focus on some ofthe core areas, including networking (QoS routing, TCP/IP congestion),distributed systems (performance, security, mobility, reliability), anddistributed applications (SCADA, Web/Internet applications, mobile appli-cations). His recent research interests are in performance (in Cloud) andsecurity (in SCADA systems). Dr. Tari regularly publishes in prestigiousjournals (like IEEE Transactions onParallel andDistributed Systems, IEEETransactions on Web Services, ACM Transactions on Databases) andconferences (ICDCS, WWW, ICSOC etc.). He co-authored two books(John Wiley) and edited more than 10 books. He has been the ProgramCommittee Chair of several international conferences, including the DOA(Distributed Object and Application Symposium), IFIP DS 11.3 onDatabase Security, and IFIP 2.6 on Data Semantics. He has also beenthe General Chair of more than 12 conferences. He is the recipient of14 ARC (AustralianResearchCouncil) grants. He is amember of the IEEE.

Panlop Zeephongsekul received the BSc de-gree with honors from Melbourne University,Melbourne, Australia, and the PhD degree fromthe University of Western Australia, Crawley,Australia. Currently, he is a Professor in the Schoolof Mathematical and Geospatial Sciences at RMITUniversity, Melbourne, Australia. His researchinterests are very wide and cover stochastic pointprocesses, fuzzy sets, game theory, queueingtheory and software reliability analysis, and hehas published extensively in these areas. His

papers have appeared in Annals of Probability, Fuzzy Sets, and Systems,IEEE Transactions on Reliability, Journal of Optimization and Theory andApplications, International Journal of Production Research, Communica-tions in Statistics (SimulationTheory/Methods), International Journal ofReliability, Quality and Safety Engineering, and many other internationaljournals. He has also been involved in many consulting projects withindustries, particularly in applied statistics and design and analysis ofexperiments.

Albert Y. Zomaya is currently the Chair Profes-sor of High Performance Computing andNetworking and Australian Research CouncilProfessorial Fellow in the School of InformationTechnologies, The University of Sydney, Sydney,Australia. He is also the Director of the Centre forDistributed and High Performance Computingwhich was established in late 2009. He is theauthor/co-author of seven books, more than 370papers, and the editor of nine books and 11conference proceedings. Prof. Zomaya is the

Editor in Chief of the IEEE Transactions on Computers and serves as anAssociate Editor for 19 leading journals. He is the recipient of theMeritorious Service Award (in 2000) and the Golden Core Recognition (in2006), both from the IEEE Computer Society. He is a Chartered Engineer(CEng), a Fellow of the AAAS, the IEEE, the IET (UK), and a Dis-tinguished Engineer of the ACM.

. For more information on this or any other computing topic,please visit our Digital Library at www.computer.org/publications/dlib.

IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 25, NO. 8, AUGUST 20142158