1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Tài liệu Hiệu suất của hệ thống thông tin máy tính P6 ppt

18 391 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Queueing scheduling
Tác giả Boudewijn R. Haverkort
Thể loại Chapter
Năm xuất bản 1998
Định dạng
Số trang 18
Dung lượng 1,18 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Using the standard MlGll result, we can compute the expected waiting times for increasing load, as indicated in Table 6.1 What can be observed is that even for small utilisations the ave

Trang 1

Chapter 6

I N this chapter we continue the study of MlGjl q ueueing models In particular, we will study the influence of various new scheduling disciplines, in comparison to the FCFS scheduling we have addressed in Chapter 5 We address non-preemptive priority scheduling

in Section 6.1 and preemptive priority scheduling in Section 6.2 A limiting case of the non-preemptive priority scheduling is shortest job next scheduling, which is discussed in Section 6.3 Then, in Section 6.4 we discuss the round robin scheduling strategy and, in Section 6.5, its limiting case, processor sharing scheduling Finally, we discuss scheduling disciplines based on the already elapsed service time of jobs in Section 6.6

Up till now we have assumed that all the jobs that need to be served have the same priority In practice, this is often not the case In communication systems, as an exam- ple, short packets that contain control information might have priority over the generally longer user packets Another case where priorities are needed is in integrated services communication systems which transmit real-time data such as voice or video samples next

to time-insensitive data Also in computer system scheduling multiple priority classes do make sense, e.g., to distinguish between interactive jobs and computation-intensive batch jobs To illustrate the need for priority scheduling, let us consider the following example

Example 6.1 A computer center without priorities

Consider a computer center where jobs enter as a Poisson process with rate X Of the

Performance of Computer Communication Systems: A Model-Based Approach.

Boudewijn R Haverkort Copyright © 1998 John Wiley & Sons Ltd ISBNs: 0-471-97228-2 (Hardback); 0-470-84192-3 (Electronic)

Trang 2

116 6 M( G 11 queueing models with various scheduling disciplines

1 0.1540 0.0222

2 0.3080 0.0542

3 0.4620 0.1046

4 0.6160 0.1953

5 0.7700 0.4076

6 0.9240 1.4803

Table 6.1: Mean waiting times E[W] ( in seconds) in a non-priority computing center

incoming jobs, a fraction pi = 40% comprises inter-active jobs with fixed length of 10 msec, and a fraction of CQ = 60% comprises batch jobs with a fixed length of 250 msec We can compute the expected service time E[S] = 0.4 x 10 + 0.6 x 250 = 154 msec We thus find that the system becomes unstable at X = l/O.154 z 6.6 job arrivals per second For the second moment we find E[S2] = 0.4 x 0.012 + 0.6 x 0.2502 = 0.0375 seconds2 Using the standard MlGll result, we can compute the expected waiting times for increasing load,

as indicated in Table 6.1

What can be observed is that even for small utilisations the average waiting time E[W]

is significantly larger than the time required to serve interactive jobs This is an undesirable situation which can be overcome by introducing (higher) priority for the interactive jobs

0

An important characteristic of priority strategies is whether they are preemptive or not:

l In preemptive priority strategies a job in service is stopped being served as soon as

a higher-priority job arrives In that case, first the higher-priority job is served, after which the service of the lower-priority job that was originally being serviced

is resumed or restarted Preemptive scheduling strategies thus order the jobs in the queue, including the one in service

l In non-preemptive priority strategies, a job in service is always first finished before a new job is put into service Non-preemptive priority strategies only order the jobs in the queue Apart from the introduced overhead, preemptive priority strategies are better for the higher-priority jobs than non-preemptive ones On the other hand, non-preemptive strategies are generally easier to implement and cause less overhead

In this section we focus on non-preemptive priority scheduling, whereas Section 6.2 is devoted to preemptive priority scheduling

Trang 3

6.1 Non-preemptive priority scheduling 117

Figure 6.1: M]G]l model with P priority classes

Let us now consider a model of a single server system in which arriving jobs can be classified in P priority classes, numbered 1 through P We assume that class 1 has the highest and class P the lowest priority Jobs of class r = 1, , P, arrive at the queueing station according to a Poisson process with rate X, The average service requirement for class r jobs is E[S,] = l/,+ The second moment of the service requirements for class r jobs is E[S,2] In Figure 6.1 we show the M]G/l model with multiple priorities Note that

we have drawn multiple queues for convenience only; one could also consider a single queue

in which the customers are ordered on the basis of their priority

We will now derive a relation between the average waiting time E[W,] of a class r job and the average waiting times of jobs of higher priority classes 1, , r - 1

A job of class r arriving at the queueing station has to wait before it can be served Its waiting time IV, consists of three components:

l The remaining service time of the job in service, if any;

l The time it costs to serve all the jobs of priority classes k = 1, , r, i.e., of all higher and equal priority jobs, that are present in the system upon the arrival of the class

r job;

l The time it costs to serve jobs of higher priority classes, i.e., jobs of classes k = l; , r - 1, that arrive during the waiting period of the class r job

In an equation, this takes the following form:

W)

Trang 4

118 6 MI G 11 queueing models with various scheduling disciplines

where W, is the waiting time of class r jobs, Tp the remaining service time of the job in service, TL the time it costs to serve all the class Ic customers that are present upon the arrival of the class r customer (note the summation index that ranges from 1 to r) , and

TL the time it costs to serve all the class k customers that arrive during IV, and that need

to be served before the class r customer (note the summation index that ranges from 1 to

r - 1) Taking expectations on both sides we obtain:

E[W,] = E[Tp] + x E[T;] + c E[T;]

We will now derive expressions for the three terms on the right hand side of this equation:

l The remaining service time of the job in service clearly depends on the class of the job that is in service A job of class r is in service with probability pT, where pr = X,E[S,], the utilisation caused by class r jobs The remaining processing time of a class r job equals E[S,2]/2E[S,] In total, we thus obtain:

E[Tp] = 5 pk= =

k=l 2E[sd

; 5 &E[s;]

k=l

(6.3)

l The term E[Ti] is determined by the number of jobs per class in the queueing station upon the arrival of the new class r job Due to the PASTA property and Little’s law we know that on average there are E[ N*,k] = &E[Wk] class k jobs upon arrival

in the queue Since they require on average I/pk amount of service each, we have

E[G] = E[&,k]/Pk = AkE[wk]/Pk = PkE[Wk]-

l Finally, we have to calculate E[T[] D uring the E[W,] time units the class r job has

to Wait, on average &E[wr] j 1 o 1s of class k arrive, each requiring I/& service Thus,

we have E[TJ = &E[Wr]/pk = pkE[W,]

Substituting these results in (6.2), we obtain

E[W,] = 5 +[S;] + 2 PkE[Wk] + ‘2 PkE[W,]

’ AI,

r-l

p AI, r-l

Trang 5

6.1 Non-preemptive priority scheduling 119

Bringing the E[W,]-t erms to the left, we obtain

Defining 0, = C’,=, Pk (with go = 0) and dividing by (1 - a,) we obtain:

E[W,] = c:z, +E[S,Z] 1 - CT, + CTk,; PkE[Wk]

(6*5)

W)

We thus have established a relation that expresses E[W,] in terms of E[W,_I] through E[W,] Taking the case f = 1 we obtain:

w.Pl E[%=] c:z, hE[S;c2]

-===

E[wll = (1-Q) 1 -pi W-d * (6.7)

Notice the similarity of this expression with the normal M]G]l waiting time formula If

P = 1, the above expression even reduces to the PK result we have seen before For the case f = 2 we obtain

Continuing this process we will recognize the following relation:

WY E[wT1 = (1 - q.)(l - q.-1)’ (6.9)

with E[Tp] = CL=, &E[$!]/2 Th’ is result is known as Cobham’s formula [57, 581 Notice that we can express the average response time for class r as

E[&] = E[S,] + WY

Example 6.2 A computer center with two priority classes

To illustrate the impact of the use of priorities, let us readdress the computer center that serves two types of customers Instead of merging the two classes we now give priority to the shorter interactive jobs In Table 6.2 we show the results For ease in comparison we also include the non-priority results We observe that the average waiting time for interactive jobs is only slightly longer than the remaining service time of the job in service (shown

in the rightmost column of the table) As can be seen, the performance improvement for interactive jobs is tremendous, at almost no performance penalty for the batch jobs •I

Trang 6

120 6 MIG 11 queueing models with various scheduling disciplines

x P EWl

1 0.1540 0.0222

2 0.3080 0.0542

3 0.4620 0.1046

4 0.6160 0.1953

5 0.7700 0.4076

6 0.9240 1.4803

Ai pi Ab Pb E[Wi] E[Wb] E[Tp]

0.4 0.004 0.6 0.15 0.0188 0.0222 0.0188 0.8 0.008 1.2 0.30 0.0378 0.0547 0.0375 1.2 0.012 1.8 0.45 0.0570 0.1059 0.0563 1.6 0.016 2.4 0.60 0.0763 0.1987 0.0750 2.0 0.020 3.0 0.75 0.0958 0.4164 0.0938 2.4 0.024 3.6 0.90 0.1154 1.5183 0.1126

Table 6.2: The waiting times in a computer center with job priorities

The non-preemptive priority scheduling strategy in fact does nothing more than change the ordering of service of arriving jobs The amount of work to be done by the queueing station remains the same Note that we assume that the overhead for “implementing” the priorities is negligible One might therefore expect that some kind of law exists that expresses that whenever one gives one class of jobs a higher priority, that other classes of jobs suffer from this

Indeed, such conservation law does exist This law expresses that the sum of the average waiting times per class, weighted by their utilisations, remains the same, independent of the priority assignment to the various classes This law, often denoted as Kleinrock’s conservation law [160] has the following form:

P

c PJv?-1 = PE~WI,

r=l

(6.11)

where p = C,‘=, pr, and E[W] is the average waiting time when there are no priority classes E [ W] can thus be derived by the normal M]G]l result Substituting pr = X,/p, (Little’s law for the server only) and E[W,] = E[N,,,]/X, (Little’s law for the queue only)

we obtain

pE[W] = 5 prE[Wr] = 5 kE[N,,l = 5 E[N,,]E[S,]

(6.12)

The right-hand side of this equation expresses a quantity that is often called the amount

of work in the system, that is, the sum over all priority classes of the number of queued jobs multiplied by their average service requirements,

Example 6.3 The conservation law for the computer center with job priorities

As an example of the conservation law reconsider the computer center with job priorities From Table 6.1 we read that for X = 5, the amount of work in the system equals 0.314 Computing piE[Wi] + pbE[Wb] f rom Table 6.2 yields the same result Cl

Trang 7

6.2 Preemptive priority scheduling 121

In non-preemptive priority scheduling, a high-priority job might have to wait for a low- priority job already in service when the former arrives To circumvent this, we might allow for the preemption of low-priority jobs by arriving high-priority jobs In a time- sharing computer system such a scheduling mechanism can be implemented very well; in

a communication system such a scheduling mechanism can be applied at the mini-packet level

A job that has been preempted can be handled in various ways when the processor restarts working on it Most efficient is to resume the work from the point where the preemption took place This is called the preemptive resume (PRS) strategy Instead of resuming the work, the job can also be restarted Two possibilities exists in this case, at least from a modelling point of view One can either repeat exactly the same job, or one can repeat a job with a service time redrawn from the service time distribution The former variant is known as the preemptive repeat identical (PRI) strategy and is what happens most often in reality The latter strategy is known as preemptive repeat diflerent (PRD)

As the PRS-strategy excludes the possibility of work being redone, it seems to be the most efficient That the PRD-strategy is more efficient than the PRI-strategy can be seen as follows First observe that the probability of a job being preempted increases when the job increases in length If such a job is then later repeated identically, it will again be long, and the probability that it is preempted remains relatively high If on the other hand

a different job drawn from the same distribution is repeated, there is a fair probability that it will be shorter than the “original” (long) one It will thus finish faster and will be preempted with a smaller probability

We now focus on the PRS-strategy For jobs of the highest priority class (class 1) the workload imposed by the lower priority classes does not matter at all Therefore, E[W,] can simply be derived via the PK-formula for class 1:

2(1- p1) = 2(1 - 01)’ (6.13) For jobs of class r = 2,-s- , P, the situation is slightly different These jobs first of all have to wait for the remaining service time of the job in service if it is of class r or higher priority, i.e.,of one of the classes 1, -9 , r The expected value of this quantity equals

(6.14)

Notice the difference with the non-preemptive case here There, the arriving job always

Trang 8

122 6 MI G 11 queueing models with various scheduling disciplines

has to wait for the completion of the job in service, regardless of its class, that is, we always deal with a remaining processing time E[Tp]

Then, similar to the non-preemptive case, the job has to wait for the completion of jobs of classes 1 through r that are already waiting when it arrives Following the same derivation as in the non-preemptive case, we obtain that the average waiting time for a job

of class r before it is put into service (denoted as IV;) equals

EKI EFvl = (1 - a,)(1 - a,-1)’ (6.15)

However, there is one element that we did not yet take into account, namely the fact that once a class r job is in service, it can be preempted by higher-priority jobs, so that extra waiting time is introduced The amount of work that flows in during the service of the class

r job and that needs to be handled first equals, on average, o,-~E[S,], i.e., the utilisation of high-priority job class multiplied by the service duration of the class r job However, also when serving this extra work, additional work might flow in: a quantity equal to c&E[S,] Taking this reasoning further reveals that the effective time to complete the service of the single class r job takes

1 - C&i’

Since the actual average service time still is E[S,], extra waiting time due to preemptions,

of length

E[srl

~ - E[S,] = ;$“’

1 - or-i T 1

(6.17)

is introduced, so that the average waiting time for a class r customer finally becomes

E[W,] = $j+E[Sr] + EITrl

(6.18)

Defining go = 0, this equation is also valid for class 1 For the average response time for class r we derive:

E[R,] = ly’;y + EITrl

T 1 (l-ar)(l -or I)’

(6.19)

Notice that in comparison with the non-preemptive case the average service time E[S,] for class r jobs is stretched by a factor (1 - a,-i)-‘, and E[Tp] has been changed to E[T,]

Example 6.4 Preemptive priorities in the computer center

We can further improve on the performance (mean waiting time) for the interactive jobs

by giving them preemptive priority over the batch jobs In Table 6.3 we show the expected

Trang 9

6.3 Shortest job next scheduling 123

non-preemptive preemptive

x P qw1 q%l JqW] JqWbl

1 0.1540 0.0188 0.0222 0.00002 0.0233

2 0.3080 0.0378 0.0547 0.00004 0.0567

3 0.4620 0.0570 0.1059 0.00006 0.1090

4 0.6160 0.0763 0.1987 0.00008 0.2028

5 0.7700 0.0958 0.4164 0.00010 0.4215

6 0.9240 0.1154 1.5183 0.00012 1.5244

Table 6.3: The waiting times (in seconds) in a computer center with non-preemptive and preemptive priorities

waiting times for the two job classes For ease of comparison, we have also included the expected waiting times in the non-preemptive priority case As can be seen, the waiting time for the interactive jobs almost vanishes; only when another interactive job is still in service does an arriving one have to wait (the probability that no such arrivals take place equals ewpi which is very close to 1) The batch jobs do suffer from this improvement only

Given that the required service times for jobs are known in advance, which is sometimes the case when transmitting packets in a communication system or when submitting “standard jobs” to a computer system, one might want to give priority to small jobs This leads to what is known as shortest job next (SJN) scheduling In fact, SJN scheduling is a form

of priority scheduling in which shorter jobs get priority over longer jobs, i.e., the length

of the job is the priority criterion Therefore, a derivation similar to the one presented in Section 6.1 is possible; however, we now deal with a continuous priority-criterion, thereby assuming that job service times or job transmission times take values in some continuous domain Again, we assume that the priority mechanism works in a non-preemptive way Let us assume that jobs arrive to the queue as a Poisson process with rate X and with service requirement S S is a random variable with probability density fs(t) We say that

a job has “priority t” whenever t 5 S < t + d-t and d-t + 0 All jobs wit.h priority t together form a Poisson process with intensity

Trang 10

124 6 MIG 11 queueing models with various scheduling disciplines

At = APr{t 5 S < t + dt} = AJ+(t)dt (6.20)

The jobs with priority t together constitute a job class with utilisation

Pt = Ad = Atfs(t)dt, (6.21)

as the (average) service requirement of class t jobs is t units of time

Analogous to or for the priority scheduling mechanism discussed in Section 6.1, we define & to be the cumulative utilisation of jobs of priority t and higher Note that a higher priority corresponds to a lower value of t Consequently, we have

pt = St XSf~(S)dS (6.22)

0

As a result, ,& = X Jam sfs(s)ds = XE[S] = p, the total utilisation

In the derivation in Section 6.1 the average remaining processing time E[Tp] of a job in service, given P different priority classes, played an important role This quantity can now

be calculated as the summation over all priority classes of the product of the probability

to find a class t customer in service and its average remaining processing time; we denote this quantity as E[T,] First note that a class t customer is in service with probability density value Pt Then note that a class t customer has a fixed service time of t seconds,

so that the average remaining processing time equals t/2 Consequently, we have

E[T,] = I* pt;dt = lrn Atfs(t)$dt = irn ;t2fs(t)dt

0

where Y is the residual service time The conditional average waiting time for a class

t customer, denoted E[Wt], now simply equals the average remaining processing time, divided by (1 - ,&) and (1 - @t-h) (h + O>, in a similar way as in (6.9) In this case, however, & and Pt-h are the same since h + 0, so that we obtain:

EEQI E[~l = (I _ pt>2 = 2(1 - /Q2 * XE[S2] (6.24) This result is known as Phipp’s formula [233] Th is conditional waiting time can be used

to calculate the unconditional waiting time as follows:

E[W] = Irn E[W]fs(t)dt (6.25)

Ngày đăng: 24/12/2013, 15:15

🧩 Sản phẩm bạn có thể quan tâm

w