Pertemuan 19 s/d 22
(minggu ke-10 dan ke-11)
Chapter 8 1
Basic properties, Markovian models, Networks of queues, General service time distributions, Finite source models, Multiserver queues
Chapter 8 2
A/B/X/Y/Z:
A = interarrival time distribution
B = service time distribution
G = general (i.e., not specified); M = Markovian
(exponential); D = deterministic
X = number of parallel service channels
Y = limit on system pop. (in queue + in service); default is
Z = queue discipline; default is FCFS (first come first served)
Others are LCFS, random, priority
Chapter 8 3
Random variables:
X ( t ) = Number of customers in the system at time t
S = Service time of an arbitrary customer
W * = Amount of time an arbitrary customer spends in the system
W
Q
* = Amount of time an arbitrary customer spends waiting for service
Often we are most interested in the averages or expectations:
L
W
L
Q
Average number in the queue
W
Q
Q
*
L
S
Average number in service
Chapter 8 4
w n
* is the time spent in the system by the n th customer.
Assume these system times are uniformly finite and let w
lim k
1 k
k n
1 be the customer average time spent in the system.
s
Also, let X
lim s
1 s
0 be the time average number of jobs in the system.
Then under very general conditions, where l a
X
l a w is the arrival rate. This is usually written L = l a
W .
w n
*
The mean number of customers in the system is proportional to the mean time in the system!
Chapter 8 5
A ( t )
B ( t ) = cum. area between curves
D ( t )
Two ways to compute
Mean time in system in (0, T ):
T
N w
T n
1
n
*
0
( ) ( ) N
( ) ( )
Mean number in system in (0, T ): ( )
( )
Then
T lim
X T
T lim
( ) ( )
( ) T
T lim
l
( ), or L
l a
W
Chapter 8 6
In queue: L
Q
In service: L
S
l a
W
Q l a
and their implications…
Expected number of busy servers L
S
l a
Expected number of idle servers
Single server utilization
Single server prob. of empty system
L
S
# servers
1 l
a
Chapter 8 7
a n d n
P n
lim t
( )
,
0,1,...
= Proportion of arriving customers that find n in the system
= Proportion of departing customers that leave behind n in the system
If customers arrive one at a time and are served one at a time then a n
d n
But these proportions may not match the limiting probability of having n in the system (long run proportion of time that n are in the system)
However, if arrivals follow a Poisson process then a n
P n
This is known as PASTA (Poisson Arrivals See Time Averages)
Chapter 8 8
Single server, Poisson arrivals (rate l
) , exponential service times (rate
)
CTMC (birth-death) model:
Chapter 8 9
P n
lim t
( )
,
0,1,...
Level-crossing equations: l
P n
P n
1
, n
0,1,
Solve for P n in terms of P
0
P n
n
0
,
1, 2,
Then use the facts that
n
0
P n
1,
n
0 r n r
1
) if r
1 and substitute to get
P n
n
(1
), n
0,1, if
1
Chapter 8 10
Steady-state expected number of customers in the system
L
Mean time in system
n
0 nP n
1
, if
1
W
l
L a
(1
1
)
1
l
Mean time in queue
W
Q
W
1
= l
by Little's Formula
Mean number in queue
L
Q
l
W
Q
= l
2
Chapter 8 11
Distribution of time in system (FCFS)
[ *
x ]
n
0 n
[ *
x n
n
0
(1
n
P W
x W * gamma( n
n
0
(1
n
l n 1 e
x
(
x ) l l
e
(1
) x
, x
0
Exponential with parameter
(1-
)
Reversibility: Departure process is Poisson with rate l
Chapter 8 12
N
Single server, exponential service times (rate
)
Poisson arrivals (rate l
) as long as there are
N in the system
CTMC (birth-death) model:
Chapter 8 13
N
P n
lim t
( )
,
Level-crossing equations: l
P n
P n
1
, n
0,1, , N
1
Solve for P n in terms of P
0
0,1,...
Then use the facts that to get P n
n
0
P n
1,
N n
0 r n
1
r
N
1
1
r
l
1
1
l
l
N
1
, n
0,1, ,
Chapter 8
N
14
N
(In the unlikely event that l
, for n
= 1,…,
N , P n
P
0
1
N
Steady-state expected number of customers in the system, L , has a “messy” closed form
Mean time in system W
L l a
by Little's Formula but here, l a is the rate of arrival into the system l a
l
1
P
N
W
Q
W
1
L
Q
l
1
P W
N
Q
Chapter 8 15
l
1
2
If arrivals to the first server follow a Poisson process and service times are exponential, then arrivals to the second server also follow a Poisson process and the two queues behave as independent M/M/1 systems:
P{ n customers at server 1 and m customers at server 2} =
l
1
1
l
1
l
2
1
l
2
Chapter 8 16
• k servers, customers arrive at server k from outside the system according to a Poisson process with rate r k
, independent of the other servers
• Upon completing service at server i , customer goes to server
For j j with probability
= 1,…,
P ij
, where
j
P
ij
1 l i
1
The number of customers at each server is independent and
If l j
<
j k , the total arrival rate to server for all j , then P{ n j is customers at server j } j
j
l
j j
1 k
l
l
P i ij j j
that is, each acts like an independent M/M/1 queue!
Chapter 8 17
• m customers move among k servers
• Upon completing service at server i , customer goes to server j with probability P ij
, where
j
P
ij
1
• Let p be the stationary probabilities for the Markov chain describing the sequence of servers visited by a customer: p j
i k
1 p
P i ij k
,
j
1 p j
1
Then the probability distribution of the number at each server is m
,
1 2
,..., n k
C m j k
1
p
j j
n j
if j k
1 n j
m
Chapter 8 18
Computation of the normalizing constant C m to get the stationary distribution can be lengthy; but may be mostly interested in the throughput where l l m
j j
1 l m
m
( j ) is the arrival rate to (and departure rate from) j .
Arrival Theorem : In the CQN with m customers, the system as seen by arrivals to server j has the same distribution as the whole system when it contains only m -1 customers.
This leads to mean value analysis to find l m
( j ) along with
W m
( j ) = the average time a customer spends at server j , and
L m
( j ) = the average number of customers at server j .
Chapter 8 19
Solve iteratively:
W m
1
L m
1
j
L m
l m
, where l m l m
m
i k
1 p
W i m
Begin with W
1
1 j
p l j m throughput
Chapter 8 20
Best combination of tractability & usefulness
• Assumption of Poisson arrivals may be reasonable based on Poisson approximation to binomial distribution
– many potential customers decide independently about arriving
(arrival = “success”),
each has small probability of arriving in any particular time interval
•
Probability of arrival in a small interval is approximately proportional to the length of the interval – no bulk arrivals
• Amount of time since last arrival gives no indication of amount of time until the next arrival (exponential – memoryless)
Chapter 8 21
Best combination of tractability & usefulness
• Exponential distribution is frequently a bad model for service times
– memorylessness
– large probability of very short service times with occasional very long service times
• May not want to use one of the “standard” distributions for service times, either
– in a real situation, collect data on service times and fit an empirical distribution
• Distributions of number of customers in the system and waiting time depend on service time distribution to be specified
Chapter 8 22
Best combination of tractability & usefulness
• Assumption of Poisson arrivals may be reasonable based on Poisson approximation to binomial distribution
– many potential customers decide independently about arriving (arrival = “success”),
- each has small probability of arriving in any particular time interval
- Distributions of number of customers in the system and waiting time depend on service time distribution
Chapter 8 23
S is the length of an arbitrary service time (random variable) l is the arrival rate of customers; define
= l
E[ S ] and assume it is < 1.
Expected values can be found from generalizing Little’s formula from # customers in the system to amount of work in the system:
An arriving customer brings S time units of work:
The time average amount of work in the system ( V )
= l
* the customer average amount of work remaining in the system
Chapter 8 24
W
Q
* is the (random variable) waiting time in queue
Expected amount of work per customer is
*
Q
0
S
S
Work remaining
S
*
Q
2
If a customer’s service time Enter
Begin service
Depart is independent of own wait in queue, get average work in system l
V
l
*
Q
2
Chapter 8 25
W
Q
= Customer mean waiting time = average work in the system when a customer arrives
From PASTA, W
Q
= V . Therefore, (Pollaczek-Khintchine formula)
W
Q
l
Q
l
2
W
Q
l
l
And the other measures of performance are:
L
Q
l
W
Q
l
2
l
, W
W
Q
, L
l
W
Chapter 8 26
Different types of customers may differ in importance.
• Type i customers arrive according to a Poisson process with rate l i and require service times with distribution G i
, i = 1, 2.
• Type 1 customers have (nonpreemptive) priority:
– service does not begin on a type 2 customer if there is a type 1 customer waiting.
– If a type 1 customer arrives during a type 2 service, the service is continued to completion.
What is the average wait in queue of a type i customer, W
Q i
Chapter 8 27
M/G/1 model with l l l
1 2
l
1 l
G x
1
l
2 l
G
2
Average work in system is
V
l
l
1
1
2
1
l l
2
l l
2
2
2
l
1
1
2
l
1
l
2
l
2
2
2
If the server is not allowed to be idle when the system is not empty, this quantity is the same for the system with priority.
Chapter 8 28
Let V i be the average amount of type i work in the system
V i l i
i i
Q in queue
l i
E S i
2
2 in service
V
Q i
V
S i
Now focus on a type 1 customer. Waiting time = amt. of type 1 work in system + amt. of type 2 work in service when this customer arrives, so
W
1
V
1
Q
V
S
2 l
1
1
Q
l
1
1
2
2
l
2
2
2
2
Chapter 8 29
W
Q
1 l
1
1
2
l
1
l
2
1
2
2
if l
1
1
1
But a type 2 customer has to wait for everyone ahead, plus any type 1 customers who arrive during the type 2 wait, so
W
Q
2 l
1
Q
2
W
Q
2
l
1
1
2
l
2 l
1
l
2
2
2
1
l
1 if l
1
1
l
2
2
1
Chapter 8 30
k
k identical machines in parallel, Poisson arrivals (rate l
) , exponential service times (rate
)
CTMC (birth-death) model:
Chapter 8 31
k
Level-crossing equations: l
P n
n
1
P n
1
, n
0,1,..., k
1 l
P n
n
1
, n
,
1,...
Define
= l
/k
P n
, solve for
( k
) n k n !
k n k !
P n
0
,
0,1,...,
P n
0
,
1, k
2,...
Then use the facts that
P
n n
0 in terms of
P n
k
1,
P n
0 r
0 n r
1
) if r
1 to get
P
0
k
1 n
0
( k n
) n
( k
) k
!
(1
) !
1
if
1
is the utilization of each server
Chapter 8 32
k
Steady-state expected number of customers in the system
L
n
0 nP n
k
( k k
!
) k
(1
)
2
P
0
, if
1
Mean flow time
W
L 1 l
k
1
l
( k
) k k !(1
)
P
0
by Little's Formula
Expected waiting time
W
Q
W
1
Expected number in the queue ( k
is expected number of busy servers)
L
Q
l
W
Q
k
Chapter 8 33
M/M/ k / k system: k servers and a capacity of k : an arrival who finds all servers busy does not enter the system (is lost)
P n
( k
) n n !
,
0,1,..., k
P i
( k
) i i !
k n
0
( k
) n n !
, i
0,..., k
Above is called Erlang’s loss formula, and it holds for M/G/ k / k as well, if k
l
Chapter 8 34