For the average number of jobs in the queue of an M ] G ] 1 queueing station the following expression has been derived: L\l - P Applying Little’s law E[W] = E[N,I/X, we obtain E[W] = ?!!
Trang 1Chapter 5
I N the previous chapter we have discussed a number of Markovian queueing models and shown various applications of them In practice, however, there are systems for which the negative exponential service times that were assumed in these models are not realistic There exist, however, also single server models that require less strict assumptions regarding the used service time distributions Examples are the MjGll model, the GIG11 model and the GiPHll model The analysis of these models is more complicated than that of the simple birth-death models encountered in Chapter 4
In this chapter we focus on the MlGll q ueueing model This model is rather generally applicable in environments where multiple users (a large population of potential customers) are using a scarce resource, such as a transmission line or a central server, for generally distributed periods of time
This chapter is organised as follows In Section 5.1 we present the well-known results for various mean performance measures of interest for the MlGll queue We pay special attention to the impact of the general service time distribution The MIGIl result can
be proven in an intuitive fashion; we do so in Section 5.2 A rigorous proof based on a embedded Markov chain is then presented in Section 5.3 In Section 5.4 we discuss an extension of the MlGll model in which batches of jobs arrive simultaneously Finally, in Section 5.5, we discuss MI G 11 queueing models with server breakdowns
Consider a single server queueing station with unlimited buffering capacity and unlimited customer population Jobs arriving at the queueing station form.a Poisson process with rate X The service requirement of a job is a random variable S, distributed according
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 296 5 M/G1 l-FCFS queueing models
to the distribution function B(s), i.e., B(s) = Pr{S 5 s} S has expectation E[S] (first moment) and second moment E[S2]
Again we use the notation E[N] for the average number of jobs in the queueing system, E[N,] for the average number of customers in the queue, and E[N,] for the average number
of customers in the server Applying Little’s law for the server alone we have: p = E[N,] = XE[S] and we assume p < 1 for stability The derivation of E[N,] is somewhat more complicated At this stage we will only present and discuss the result Proofs will be postponed to later sections
For the average number of jobs in the queue of an M ] G ] 1 queueing station the following expression has been derived:
L\l - P)
Applying Little’s law (E[W] = E[N,I/X), we obtain
E[W] = ?!!!!%
20 - P>
These two equations only address the queueing part
(5.2)
of the overall queueing station By including the service, we arrive at the following expressions:
X2E[S2]
E[N] = XE[S] + ~
20 - P)’
XE[S2]
E[R] = E[S] + ~
w - P>’
The M]G]l result is presented mostly in one of the four forms above The form (5.3) is often referred to as the Pollaczek-Khintchine (or PK-) formula Let us discuss this equation
in more detail now
Looking at the PK-formula we observe that E[N] depends on the first and second moment of the service time distribution What does this imply? From the first two moments of a distribution its variance can be obtained as ai = E[(S - E[S])2] = E[S2] - E[S12 We thus see that a higher variance implies a higher average number of jobs in the system From a queueing point of view, exhibiting no variance in the service times (E[S2] = E[S12) * pt 1s o imal This is a very general observation: the more variability exists
in the system, the worse the performance With worse performance we of course mean longer queues, longer waiting times etc
Example 5.1 Influence of variance
Consider two almost equivalent queueing stations In the first one the service requirement
Trang 35.1 The MIGII result 97
is 1, deterministically, i.e., E[Si] = 1 and E[SF] = 1 so that var[Si] = 0 In the second the service requirement is also 1 on average, but the actual values are either 0.5 or 1.5 (with probability 0.5 each), i.e., E[Sz] = 1 and E[Sg] = 0.5(0.5)2+0.5(1.5)2 = 1.25, so that var[S2] = 0.25 Consequently, in the second system, the average waiting times will be 25% higher than in the first system, although the average work requirements are the same! •I
Example 5.2 Infinite variance
Consider a queueing station at which jobs arrive as a Poisson process with rate X = 0.4 The service requirement S has a probability density function fs (s) = 2/s3, whenever s 2 1, and fs(s) = 0, whenever s < 1 Calculating the average service time, we obtain
E[S] = Am sfs(s)ds = Lrn 2~-~ds = (-2s-‘)lIT = 2 (seconds)
Clearly, since p = XE[S] = 0.8 < 1 the queueing station is stable However, when calcu- lating the second moment of the service time distribution, we obtain
,qs2] = irn s2fs(s)ds = Srn 2s-‘ds = (2 Ins)::;” = ~0
1
Application of the PK formula thus reveals that E[N] = 00, even though the queue is not
It is important to note that not the total MlGll q ueueing or waiting time behaviour
is given by the first two moments of the service time distribution, but only the averages The effect that the performance becomes worse when the variance of the service time distribution increases becomes clear nicely when we use the squared coefficient of variation
in our formulae The squared coefficient of variation of a stochastic variable X, that is, c; = a;/E[X12, expresses the variance of a random variable relative to its (squared) mean Using this notation the PK-formula can be rewritten as:
E[N] = XE[S] + ww1)20 + G> = p + P2(1 + G>
We observe that E[N] increases linearly with Cg For E[W] we obtain a similar equation:
E[W] = JwS12(1 + G> = dwl(1+ c;>
Before we end this section with two examples, we make a few remarks about the applica- bility of the PK-formula:
Trang 498 5 MIGI l-FCFS queueing models
1 The arrival and service processes must be independent of each other
2 The server should be world conserving,
whenever there are jobs to be served
meaning that the server may never be idle
3 The scheduling discipline is not allowed to base job scheduling on a priori knowledge about the service times, e.g., shortest-job-next scheduling is not allowed Disciplines that are allowed are e.g., FCFS or LCFS
4 The scheduling discipline should
be interrupted
be non-preemptive, i.e., jobs being served may not
Example 5.3 A simple communication channel
Consider a buffered 10 kbps (kilo bit per second) communication channel, over which two types of packets have to be transmitted The overall stream of packets constitutes
a Poisson process with arrival rate X = 40 packets per second (p/s) Of the arriving packets, a fraction cvr = 0.2 is short; the remaining packets, a fraction CQ = 0.8 is long Short packets have an average length E[Sr] = 10 bits, whereas long packets are on average E[S2] = 200 bits Both packet lengths are exponentially distributed We are interested
in the average waiting time for and the average number of packets in the communication channel
This system can be modelled as an M]G] 1 queueing station at which packets arrive
as a Poisson stream with intensity 40 p/s The fact that we have two types of packets which are of different lengths, can be coped with by choosing an appropriate service time distribution The appropriate distribution in this case is the hyperexponential distribution with 2 stages (see also Appendix A) The hyperexponential density function with r stages has the following form: f(x) = CI=‘=, a+ie-pXZ:, where l/pi is the time it takes to transmit
a packet of class i, and CI=‘=, ai = 1 The average value then equals CI=‘=, cri/pi, and the variance 2 Cr=‘=, &i/p: - (Ci=, c~i/pi)~
Let us first calculate the /.J; by taking into account the packet sizes and the channel transmission speed ~1 = 10 kbps/lO bits/packet = 1000 p/s In a similar way we obtain p2 = 104/200 = 50 p/s For th e utilisation we find p = ~~=, Xaii/pi = 0.648 Applying the formula for the service time variance, we obtain 0: = 0.3164 msec, whereas E[S2] = 6.404 x 10m4 Substituting these results in the M]G]l result for E[W] and E[N] we obtain:
E[W] = 40 6.404 x 1O-4
2(1 - 0.648) = 36.39 msec (5.7)
Trang 55.2 An intuitive proof of the MIG11 result 99
Applying Little’s law we obtain E[N] = p + XE[W] = 2.1034 packets
If we would have modelled this system as an MIMI1 queue with X = 40 and E[S] = 0.0162, we would have obtained E[W] = 19.82 msec, and E[N] = 1.841 packets Here we clearly see the importance of using the correct model 0
Example 5.4 Comparing M/MIl, MIE211, M/Hzll, and MIDll
We now proceed with comparing four queueing stations: an MIMI 1, an M]E2 ] 1, an M]Hz ] 1 and an MID] 1 These models only differ by their service requirement distribution We assume that the mean value of the distributions is the same and equal to 1 In the M]H2]l case we assume that al = o2 = 0.5 and that ~1 = 2.0 and ~2 = 2/3 The performance metric we will use as a comparison is the average number of jobs in the queueing station Let us first derive the coefficients of variation of the four service time distributions involved For the deterministic distribution we have Ci = 0 For the exponential dis- tribution CM 2 = 1, for the a-stage Erlang distribution C’& = l/2 and for the 2-stage hyperexponential distribution we have C, 2 = 1.5 Substituting this in (5.6) we obtain:
Jqw?] = Pwl(l+ 0) z-z PJWI
w - P) 2(1 - P)
w - P) = +[W4]7
w - P) = ;E[&]
We observe that in the case of deterministic service times, the waiting times reduce 50% in comparison to the exponential case A reduction to 75% can be observed for the Erlang-
2 case, whereas an increase to 125% can be observed for the hyperexponential case In Figure 5.1 we show the curves for the average waiting times E[W] (for the deterministic, the hyperexponential and the exponential service time distribution) as a function of the
In this section we will give an intuitive proof of the M]G] 1 result as discussed in the previous section For this intuitive proof we will use the PASTA property discussed in Section 4.3
Trang 6100 5 M 1 G 1 l-FCFS queueing models
25
20
15
E[Wl
10
5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
P
Figure 5.1: Comparison of the MIHall, the MIMI1 and the MID/l queueing systems (top
to bottom): the average waiting time E[W] as a function of the utilisation p
Furthermore, we will need information about the so-called residual lifetime of a stochastic variable We will discuss this issue in Section 5.2.1 before we prove the M 1 G I 1 result in Section 5.2.2
5.2.1 Residual lifetime
Consider a Poisson arrival process The time between successive arrivals is exponentially distributed From the memoryless property that holds for these exponentially distributed interarrival times we know that when we observe this Poisson process at any point in time, the time from that observation until the next arrival is again exponentially distributed This is in fact a very peculiar property which, as we will see later, has some interesting implications which have puzzled probability engineers a long time
Let us now try to derive the residual lifetime distribution of a more general renewal process Assume that we deal with a renewal process where the interevent times X are distributed with (positive) density function fx(~) If we observe this process at some random time instance, we denote the time until the next event as Y, the so-called residual lifetime or the forward recurrence time The time from the observation instance to the previous event is denoted 7’ and called the backward recurrence time We denote the length
of the interval in which the observation takes place, i.e., the “intercept>ed” interval, with a
Trang 75.2 An intuitive proof of the MlGll result 101
X z _ x
X: interevent time
\I \I 2: intercepted interval length
I\ h I\ T: backward recurrence time
T
< I Y Y: forward recurrence time
arrival
Figure 5.2: Stochastic variables involved in the derivation of the residual lifetime
stochastic variable 2 Note that 2 does not have the same distribution as X, although one
is tempted to think so at first sight Since longer intervals have higher probability to be intercepted, a shift of probability mass from lower to higher values can be observed when comparing the density functions of X and 2 In Figure 5.2 we show the various stochastic variables
It is reasonable to assume that the probability that the random observation falls in
an interval with length z is proportional to the length of z and to the relative occurrence probability of such an interval, which equals fx (z)dz We thus have that fi(z)dz = Cxfx(z)dz, where C is a constant which assures that fi(z) is indeed a proper density function Taking the integral from 0 to infinity should yield 1, i.e.,
Jdm f&)dz = Srn Czf&)dz = CE[X] = 1,
so that we must conclude that C = l/E[X] and
Tfx(4 f&> = qX] * (5.9)
Now that we have an expression for fi (z), we will derive an expression for fvlz (y) , the probability density of Y, given a particular 2 Together with ii(z) we can then derive
fu ( y ) by unconditioning
Assume that we have “intercepted” an interval with length z Given such an interval, the only reasonable assumption we can make is that the actual random observation point occurs in this interval according to a uniform distribution Consequently, we have
Trang 8102 5 Ml Gf l-FCFS queueing models
Now, applying the law of conditional probability, we obtain:
f-w+7 34 = fz(z)fy,z(y~z)
Kfx(4 1
= E[Xlz
.fx (4
~ O<y~z<m
= E[X]’
In order to obtain fy (y) we now have to integrate over all possible z:
(5.11)
(5.12)
We thus have obtained the density function of Y, the forward recurrence time A similar expression can, by similar arguments, be derived for the backward recurrence time 7’ Applying this result now for deriving E[Y] we obtain:
WI = Am YfYWY
1
= E[X] 0 O” Y(l - Fx(Y))dY
1
= E[X] K iy2(1 - Fx(q; + km ;Y2fxw9)
1
= 2E[X] s c0 Y2fx (?I)& o
JW21
by using partial integration (J uw’ = uv - J U’ZI) In the same way, we have
E[T] = E[X2]/2E[X] (5.14)
It is important to observe that the expected forward/backward recurrence time is not equal
to half the expected lifetime!
Example 5.5 Exponentially distributed periods X
Let us now apply these results to the case where X is exponentially distributed with rate
X Calculating
1 - (1 - eeXy)
= XemXY = fx(y), (5.15)
Trang 95.2 An intuitive proof of the MlGll result 103
reveals that the residual lifetime is distributed similarly to the overall lifetime This is exactly the memoryless property of the exponential distribution A similar derivation can
be made for the backward recurrence time The expected residual lifetime equals
E[Y] = gq = g = l/X (5.16)
Similarly, we have E[T] = l/X N ow, since E[Z] = E[T] + E[Y] = 2/X, we see that E[Z] # E[X] Th is inequality is also known as the waiting time paradox It can be understood by imagining that long intervals X have more probability to be “hit” by a random observer This implies that in 2 the longer intervals from X are more strongly
Example 5.6 Deterministic periods X
In case the random intervals X are not really random but have deterministic length, we have E[X2] = E[X12 In that case, the forward recurrence time equals E[X2]/2E[X] which reduces to E[X]/2 We find that the, maybe intuitively appealing, value for the forward recurrence time, namely half the normal time, is only correct when the time periods themselves are of deterministic length 0
Example 5.7 Waiting on a bus
Consider the case where at a bus stop a bus arrives according to the schedule at x.00, x.20 and x.40, i.e., three times an hour at equidistance points per hour If one would go to the bus stop at random time-instances, one is tempted to think that one would have to wait
on average 10 minutes for the next bus to come This is, however, not correct Although the “inter-bus” times B are planned to be exactly 20 minutes, in practice they are not, hence, the variance in the inter-bus times is positive, and so E[B2] > E[B12 The correct expected waiting time for the bus is E[B2]/2E[B], which is larger than E[B]/2 When the
“inter-bus” times are deterministic, the expected waiting time is 10 minutes Cl
5.2.2 Intuitive proof
Combining the results of the previous section with the PASTA property, we are in a position
to intuitively prove the PK-result We are interested in the average response time E[R] a job perceives in an M]G] 1 queueing station Jobs arrive as a Poisson stream with rate X The service time per jpb is a random variable S with first and second moment E[S] and
Trang 10104 5 MI G) l-FCFS queueing models
E[S2] respectively For the derivation, which is similar to the derivation for the M]M] 1 queue presented in Chapter 2, we assume an FCFS scheduling discipline
At the moment a new job arrives, it will find, due to the PASTA property, E[N] jobs already in the system Of these jobs, on average p = XE[S] will reside in the server, and consequently, on average E[N,] = E[N] - p jobs will reside in the queue The average response time E[R] for the arriving job can then be seen as the sum of three parts:
l E[Rr]: the residual service time of the job in service, if any at all;
l E[R2]: the service time for the jobs queued in front of the newly arriving packet;
l E[.&]: the service time of the new job itself
The term E[Rr] equals the product of the probability that there is a packet in service and the mean residual service time, i.e., E[Rr] = pE[S2]/2E[S] The E[N] -p jobs in the queue
in total require on average E[&] = (E[N] - p)E[S] t ime to be served The packet itself requires E[&] = E[S] amount of service Noting that due to Little’s law E[N] = XE[R],
we have:
Jw21
= p2E[sl+ wwl - dW1 + WI
+ (1 - p)E[R] = pm + E[S](l - p)
=wl
XE[S2]
=+ E[R] = E[S] + ~
This is the result that we have seen before and concludes our proof This intuitively appealing form of proof, based on mean-values, is also known as “the method of moments”
We will see examples of it in later chapters as well
One of the difficulties in analysing the MI G 11 queue is the fact that the state of the queue
is not simply given by the number of jobs in the queue as was the case with the MIMI1 model Because of the fact that the service time distribution is not memoryless any more, the time a particular job has already been served has to be represented in the state of the queueing stat ion Consequently, we deal with a stochastic process with a state variable that takes values in the two-dimensional mixed discrete-continuous set IV x I? There is,