Slide set 21 Stat 330 (Spring 2015) Last update: March 22, 2015

advertisement
Slide set 21
Stat 330 (Spring 2015)
Last update: March 22, 2015
Stat 330 (Spring 2015): slide set 21
Queuing systems
Depending upon the specific application there are many varieties of queuing
systems:
• size & nature of arriving population: finite or a (potentially) infinite set?
homogenous, i.e. only one type of individuals, or several types?
• random mechanism by which the population enters
• nature of the queue: finite/ infinite
• nature of the queuing discipline: FIF0 or priority (i.e. different types of
individuals get different treatment)
• number and behavior of servers; distribution of service times?
1
Stat 330 (Spring 2015): slide set 21
Queuing systems (cont’d)
Variety of properties of queues one might want to investigate:
•
mean number of individuals in the system
•
mean queue length
•
fraction of customers turned away (for a finite queue length)
•
mean waiting time, etc.
Notation: FY /FS /c/K
• FY distribution of inter arrival times Y
• FS distribution of service times S
• c number of servers
• K maximum number of individuals in the system
Usually, we will assume a FIFO queue.
2
Stat 330 (Spring 2015): slide set 21
Queuing systems (cont’d)
The distributions FY and FS are chosen from a small set of distributions,
denoted by:
• M exponential (Memoryless) distribution
• Ek Erlang k stage
• D deterministic distribution
• G a general, not further specified distribution
The main properties of interest for a queuing system:
• L average length of system = average # of individuals in the system
• W average waiting time (time in queue and service time
• Ws average service time
• Wq average waiting time in queue
• Lq average length of queue
3
Stat 330 (Spring 2015): slide set 21
Model queueing systems as Stochastic processes
• The main idea of a queuing system is to model the number of individuals
in the system (queue and server) as a Birth & Death Process.
• We model the number of individuals in the system at time t as the Birth
& Death Process X(t)
• This gives us a way to analyze the queuing systems using the methods
from the previous chapter.
• The theorem below links waiting times to the number of people in the
system and will be very useful in the future
Little’s Law: For a queuing system in steady state
L = λ̄ · W
where
L is the average number of individuals in the system,
W is the average time spent in the system, and
λ̄ is the average rate at which individuals enter the system.
4
Stat 330 (Spring 2015): slide set 21
More on Little’s Theorem
This theorem can also be applied to the queue itself:
Lq = λ¯q · Wq
or to the server
Ls = λ¯s · Ws.
Relationship between properties
For computing the properties L, W, Ws, Wq , Lq there are usually two
different ways: an easy way and a difficult one.
To choose the easier way of computation, the following overview of the
relationships between these properties helps:
5
Stat 330 (Spring 2015): slide set 21
Birth & Death Transition Diagrams
A way to visualize what is going on in the queuing system is the birth &
death transition diagram.
For c servers and an overall capacity of K (where K may be = ∞) the
transition diagram looks like this:
6
Stat 330 (Spring 2015): slide set 21
The M/M/1 Queue
Situation: exponential inter arrival times with rate λ, exponential service
times with rate µ.
Let N (t) denote the number of individuals in the system at time t, N (t)
can then be modeled using a Birth & Death process:
λk = birth rate = arrival rate = λ for all k
µk = death rate = service rate = µ for all k
We’ve already seen that the ratio λ/µ is very important for the analysis of
the B&D process.
This ratio is called the traffic intensity a. For a M/M/1 queuing system,
the traffic intensity is constant for all k.
The problem of finding the steady state probabilities of the B&D process
is equivalent to finding the steady state probabilities for the number of
individuals in the queuing system,
pk = limt→∞ P (N (t) = k).
7
Stat 330 (Spring 2015): slide set 21
The M/M/1 Queue (cont’d)
The B&D balance equations then say that 1 = p0(1 + a + a2 + . . .)
We have a system with a steady state if a < 1.
P∞ k
1
, then
If a < 1 S = k=0 a = 1−a
p0 = 1 − a
p1 = a(1 − a)
p2 = a2(1 − a)
p3 = a3(1 − a)
...
pk
= ak (1 − a)
N (t) therefore has a (modified) geometric distribution for large t!
8
Stat 330 (Spring 2015): slide set 21
The M/M/1 Queue (cont’d)
It is a modified geometric distribution, as N (t) can be 0 (empty system).
Thus N (t) + 1 has a Geometric distribution Geo(1 − a).
We can use that to get the expected value of N (t):
The average number of individuals in the queuing system, L, is
limt→∞ E[N (t)]:
L = lim E[N (t)] = lim E[N (t) + 1] − 1 =
t→∞
t→∞
a
1
−1=
.
1−a
1−a
Note that L gets larger as a gets closer to 1, that is, as the service rate
gets closer to the arrival rate.
Thus, the closer the service rate is to the arrival rate, the larger is the
expected number of people in the system.
9
Stat 330 (Spring 2015): slide set 21
The M/M/1 Queue (cont’d)
The mean time spent in the queueing system, W is then, using Little’s Law:
1
1
W = L/λ = ·
µ 1−a
The overall time spent in the system is a sum of the time spent in the
queue Wq and the average time spent in service Ws i.e. W = Wq + Ws
Since we know that service times are exponentially distributed with rate µ,
the the average waiting time is Ws = µ1 .
Thus, the average time spent waiting in the queue is:
1
Wq = W − Ws = ·
µ
1
1 a
−1 =
.
1−a
µ1 − a
10
Stat 330 (Spring 2015): slide set 21
The M/M/1 Queue (cont’d)
The average length of the queue is, using Little’s Law again, is:
a2
Lq = Wq λ =
1−a
Further we see, that the long run probability that the server is busy is given
as:
P (server busy) = 1 − P (system empty) = 1 − p0 = a.
This is the server utilization rate.
Distribution of time in the queue: Denote by q(t) the time that an individual
entering the system at time t has to spend waiting in the queue.
Clearly, the distribution of the waiting times depends on the number of
individuals already in the queue at time t.
11
Stat 330 (Spring 2015): slide set 21
The M/M/1 Queue (cont’d)
The individual entering the system doesn’t have to wait at all in the queue
when the system at time t is empty.
For large t we therefore get:
limt→∞ P (q(t) = 0) = p0 = 1 − a.
If there are k individuals in the queue, the waiting time q(t) is Erlang(k, µ)
(i.e., k departures with departures occurring with a rate of µ).
This is a conditional distribution, since it is the distribution of q(t) given
that the number of people in the system is k:
q(t)|X(t) = k ∼ Erlang(k, µ)
for large t
We can put those pieces together in order to get the large t distribution for
q(t) using the the total probability law.
12
Stat 330 (Spring 2015): slide set 21
The M/M/1 Queue (cont’d)
For large t and x ≥ 0:
Fq(t)(x)
=
=
P (q(t) ≤ x) =
∞
X
now use total probability law!
P (q(t) ≤ x ∩ X(t) = k)
k=0
=
∞
X
P (q(t) ≤ x|X(t) = k)pk
k=0
=
∞
X
p0 +
(1 − P oµx(k − 1))pk
k=1
=
∞
k−1
j
X
X
−µx (xµ)
p0 +
(1 −
e
)pk = . . .
j!
j=0
k=1
=
1 − ae
−x/W
,
where W is the average time spent in the system, W =
1
µ
1
· 1−a
=
1
µ−λ .
13
Download