Chapter 8

Queueing Models

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.1 Contents

• Characteristics of Queueing Systems • QQgueueing Notation – Kendall Notation • Long-run Measures of Performance of Queueing Systems • Steady-state Behavior of Infinite-Population Markovian Models • Steady-state Behavior of Finite-Population Models • Networks of Queues

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.2 Purpose

• Simulation is often used in the analysis of queueing models. • A simple but typical queueing model

Calling population

Waiting line Server

• Queueing models provide the analyst with a powerful tool for designing and evaluating the performance of queueing systems. • Typical measures of system performance • Server utilization, length of waiting lines, and delays of customers • For relatively simple systems: compute mathematically • For realistic models of complex systems: simulation is usually required

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.3 Outline

• Discuss some well-known models • Not developpqgy,ment of queueing theory, for this see other class!

• We will deal with • General characteristics of queues • Meanings and relationships of important performance measures • Estimation of mean measures of performance • Effect of varying input parameters • Mathematical solutions of some basic queueing models

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.4 Characteristics of Queueing Systems

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.5 Characteristics of Queueing Systems

• Key elements of queueing systems • Customer: refers to anything that arrives at a facility and requires service, e.g., people, machines, trucks, emails, packets, frames. • Server: refers to any resource that provides the requested service, e.g., repairpersons, machines, runways at airport, host, switch, router, disk drive, algorithm.

System Customers Server Reception desk People Receptionist Hospital Patients Nurses Airport Airpl anes Runway Production line Cases Case-packer Road network Cars Traffic light Grocery Shoppers Checkout station Computer Jobs CPU, disk, CD NtNetwor k PktPackets RtRouter

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.6 Calling Population

• Calling population: the population of potential customers, may be assumed to be finite or infinite. • Finite population model: if arrival rate depends on the number of customers being served and waiting, e.g., model of one corporate jet, if it is being repaired, the repair arrival rate becomes zero.

n n-1

• IfiitInfinite popul ltiation mo dldel: if arr iva l ra te is no t afftdffected by the number of customers being served and waiting, e.g., systems with large population of potential customers. ∞

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.7 System Capacity

• System Capacity: a limit on the number of customers that may be in the waiting line or system. • Limited capacity, e.g., an automatic car wash only has room for 10 cars to wait in line to enter the mechanism. • If system is full no customers are accepted anymore

Waiting line Server

• Unlimited capacity, e.g., concert ticket sales with no limit on the number of people allowed to wait to purchase tickets.

Waiting line Server

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.8 Arrival Process • For infinite-population models: • In terms of interarrival times of successive customers. • Arrival types: • Random arrivals: interarrival times usually characterized by a . • Most important model: Poisson arrival process (with rate λ), where a time represents the interarrival time between customer n-1 and customer n, and is exppyonentially distributed ( with mean 1/λ). • Scheduled arrivals: interarrival times can be constant or constant plus or minus a small random amount to represent early or late arrivals. • Example: patients to a physician or scheduled airline flight arrivals to an airport • At least one customer is assumed to always be present, so the server is never idle, e.g., sufficient raw material for a machine.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.9 Arrival Process

• For finite-population models: • Customer is ppgending when the customer is outside the qqgueueing system, e.g., machine-repair problem: a machine is “pending” when it is operating, it becomes “not pending” the instant it demands service from the repairman. • Runtime of a customer is the length of time from departure from the queueing system until that customer’s next arrival to the qq,g,ueue, e.g., machine-repppair problem , machines are customers and a runtime is time to failure (TTF). (i) (i) (i) • Let A1 , A2 , … be the successive runtimes of customer i, and S1 , (i) S2 be the corresppgonding successive s ystem times:

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.10 Queue Behavior and Queue Discipline

• Queue behavior: the actions of customers while in a queue waiting for service to begin, for example: • Balk: leave when they see that the line is too long • Renege: leave after being in the line when its moving too slowly • Jockey: move from one line to a shorter line

• Queue discipline: the logical ordering of customers in a queue that determines which customer is chosen for service when a server becomes free, for example: • Firs t-in-first -out (FIFO) • Last-in-first-out (LIFO) • Service in random order (()SIRO) • Shortest processing time first (SPT) • Service according to priority (PR)

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.11 Service Times and Service Mechanism

• Service times of successive arrivals are denoted by S1, S2, S3. • May be constant or random.

• {S1, S2, S3, …} is usually characterized as a sequence of independent and identically distributed (IID) random variables, e.g., • Exponential, Weibull, Gamma, Lognormal, and Truncated normal distribution.

• A queueing system consists of a number of service centers and interconnected queues. • Each service center consists of some number of servers (c) working in parallel, upon getting to the head of the line, a customer takes the 1st available server.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.12 Queuing System: Example 1

• Example: consider a discount warehouse where customers may • serve themselves before paying at the cashier (service center 1) or • served by a clerk (service center 2)

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.13 Queuing System: Example 1 • Wait for one of the three clerks:

• Batch service (a server serving several customers simultaneously), or customer requires several servers simultaneously.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.14 Queuing System: Example 1

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.15 Queuing System: Example 2

• Candy production line • Three machines seppyarated by buffers • Buffers have capacity of 1000 candies

Assumption:Allways sufficient supply of raw material.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.16 Queueing Notation The Kendall Notation

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.17 Queueing Notation: Kendall Notation

• A notation system for parallel server queues: A/B/c/N/K • A represents the interarrival-time distribution • B represents the service-time distribution • c represents the number of parallel servers • N represents the system capacity • K represents the size ooagpopuaof the calling population • N, K are usually dropped, if they are infinity • Common symbols for A and B • M Markov,,p • D Constant, deterministic

• Ek distribution of order k • H Hyperexponential distribution • G General, arbitrary • Examples • M/M/1/∞/∞ same as M/M/1: Single-server with unlimited capacity and call- popula tion. In terarr iva l an d serv ice times are exponen tia lly dis tr ibu te d • G/G/1/5/5: Single-server with capacity 5 and call-population 5. • M/M/5/20/1500/FIFO: Five parallel server with capacity 20, call-population 1500, and service discipline FIFO

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.18 Queueing Notation • General performance measures of queueing systems: • Pn steady-state probability of having n customers in system • Pn(t) probability of n customers in system at time t • λ arrival rate

• λe effective arrival rate • μ service rate of one server • ρ server utilization

• An interarrival time between customers n-1 and n • Sn service time of the n-th arriving customer • Wn total time spent in system by the n-th customer Q • Wn total time spent in the waiting line by customer n • L(t) the number of customers in system at time t

• LQ(t) the number of customers in queue at time t • L long-run time-average number of customers in system

• LQ long-run time-average number of customers in queue • W long-run average time spent in system per customer

• wQ long-run average time spent in queue per customer

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.19 Long-run Measures of Performance of Queueing Systems

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.20 Long-run Measures of Performance of Queueing Systems

• Primary long-run measures of performance are • L long-run time-average number of customers in system

• LQ long-run time-average number of customers in queue • W long-run average time spent in system per customer

• wQ long-run average time spent in queue per customer • ρ server utilization

• Other measures of interest are • Long-run proportion of customers who are delayed longer than

t0 time units • Long-run proportion of customers turned away because of capacity constraints • Long-run proportion of time the waiting line contains more

than k0 customers

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.21 Long-run Measures of Performance of Queueing Systems

• Goal of this section • Majjpor measures of performance for a general G/G/c/N/K queueing system • How these measures can be estimated from simulation runs

• Two types of estimators • Sample average • Time-integrated sample average

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.22 Time-Average Number in System L

Number of customers in the system

Time

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.23 Time-Average Number in System L

• Consider a queueing system over a period of time T

• Let Ti denote the total time during [0,T ] in which the system containedld exactly i customers, the time-weighdhted-average number in the system is defined by: ∞ ∞ ˆ 1 ⎛ Ti ⎞ L = ∑iTi = ∑i⎜ ⎟ T i=0 i=0 ⎝ T ⎠

• Consider the total area under the function is L(t), then,

∞ ˆ 1 1 T L = iTi = L(t)dt ∑ ∫0 T i=0 T

• The long-run time-average number of customers in system, with probability 1: 1 T Lˆ = L(t)dt ⎯⎯→⎯ L T ∫0 T →∞

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.24 Time-Average Number in System L

Number of customers in the system

Time

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.25 Time-Average Number in System L

• The time-weighted-average number in queue is:

∞ T ˆ 1 Q 1 LQ = iTi = LQ (t)dt ⎯⎯⎯→ LQ ∑ ∫0 T →∞ T i=0 T • G/G/1/N/K example: consider the results from the queueing system (N ≥ 4, K ≥ 3).

Lˆ = [0(3) +1(12) + 2(4) + 3(1)]/ 20 = 23/ 20 =1.15 customers

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.26 Time-Average Number in System L

⎧0, if L(t) = 0 ˆ 0(15) +1(4) + 2(1) LQ (t) = ⎨ LQ = = 0.3 customers ⎩L(t) −1, if L(t) ≥1 20

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.27 Average Time Spent in System Per Customer w

• The average time spent in system per customer, called the average system time, is: 1 N ˆ w = ∑Wi N i=1

where W1, W2, …, WN are the individual times that each of the N customers spend in the system during [0,T].

• For stable systems: wˆ → w as N → ∞

• If the system under consideration is the queue alone:

1 N wˆ W Q w Q = ∑ i ⎯N⎯→⎯∞→ Q N i=1

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.28 Average Time Spent in System Per Customer w

• G/G/1/N/K example (cont.):

• The averaggye system time is ( Wi = Di – Ai) W +W +...+W 2 + (8 − 3) + (10 − 5) + (14 − 7) + (20 −16) wˆ = 1 2 5 = = 4.6 time units 5 5 0 + 0 + 3+ 3+ 0 • The average queuing time is wˆ = =1.2 time units Q 5

A4 D2

A3 D3

A1 D1 A2 D4 A5 D5

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.29 The Conservation Equation or Little’s Law

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.30 The Conservation Equation: Little’s Law

• One of the most common theorems in queueing theory • Mean number of customers in system • Conservation equation (a.k.a. Little’s law)

ArrivalsBlack Box Departures

average number in system = arrival rate × average system time

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.31 The Conservation Equation: Little’s Law

• Conservation equation (a.k.a. Little’s law) ˆ ˆ Average # in L = λwˆ Average system System time AiArriva l rate

L = λw as T → ∞ and N → ∞

• Holds for almost all qqgyueueing systems or subsy y(gstems (regardless of the number of servers, the queue discipline, or other special circumstances). • G/G/1/N/K exampp(le (cont. ): On avera g,ge, one arrival every 4 time units and each arrival spends 4.6 time units in the system. Hence, at an arbitrary point in time, there are (1/4)(4.6) = 1.15 customers present on average.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.32 Server Utilization

• Definition: the proportion of time that a server is busy. • Observed server utilization, ,ρˆ is defined over a specified time interval [0,T ]. • Long-run server utilization is ρ. • For syygstems with long-run stability: ρˆ → ρ as T → ∞

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.33 Server Utilization

• For G/G/1/∞/∞ queues: • Any single-server queueing system with • average arrival rate λ customers per time unit, • average service time E(S)=1/μ time units, and • infinite queue capacity and calling population. • Conservation equation, L = λw, can be applied.

• For a stable system, the average arrival rate to the server, λs, must be identical to λ. • The average number of customers in the server is:

1 T T −T Lˆ = ()L(t) − L (t) dt = 0 s ∫ Q T 0 T

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.34 Server Utilization

• In general, for a single-server queue:

ˆ ˆ Ls = ρ ⎯T⎯→⎯∞→ Ls = ρ λ and ρ = λ ⋅ E(s) = μ

λ • For a single-server stable queue: ρ = < 1 μ

• For an unstable queue (λ > μ), long-run server utilization is 1.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.35 Server Utilization

• For G/G/c/∞/∞ queues: • A system with c identical servers in parallel. • If an arriving customer finds more than one server idle, the customer chooses a server without favoring any particular server. • For systems in statistical equilibrium, the average number of busy servers, L , is: s λ L = λE(S) = S μ • Clearly 0 ≤ LS ≤ c • The long-run average server utilization is:

L λ ρ = s = , where λ < cμ for stable systems c cμ

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.36 Server Utilization and System Performance

• System performance varies widely for a given utilization ρ. • For example, a D/D/1 queue where E(A) = 1/λ and E(S) = 1/μ, where:

L = ρ = λ/μ, w = E(S) =1/μ, LQ = WQ =0 • By varying λ and μ, server utilization can assume any value between 0 and 1.

• In general, variibilitability of itinterarr iva l and service times causes lines to fluctuate in length.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.37 Server Utilization and System Performance

• Example: A physician who • Consider the system is schedules patients every 10 simulated with service times: minutes and spends Si minutes S = 9, S =12, S = 9, S = 9, S = 9,... with the i-th patient: 1 2 3 4 5 ⎧ 9 minutes with probability 0.9 • The system becomes: Si = ⎨ ⎩12 minutes with probability 0.1

• Arrivals are deterministic: -1 A1 = A2 = … = λ = 10

• Services are stochastic

• E(Si) =93min= 9.3 min 2 • V(S0) = 0.81 min • σ = 0.9 min • The occurrence of a relatively long service time • On average, the physician's ( ) causes a waiting line utilization is S2 = 12 ρ = λ/μ = 0.93 < 1 to form temporarily.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.38 Costs in Queueing Problems • Costs can be associated with various aspects of the waiting line or servers: • System incurs a cost for each customcustomerer in the queue, say at a rate of $10 per hour per customer. W Q is the time • The average cost per customer is: j customer j spends in queue N $10⋅W Q j = $10⋅ wˆ ∑ N Q λ j=1 • If λ ˆ customers per hour arrive (on average), the average cost per hour is: ˆ ⎛ customer ⎞⎛ $10⋅ wˆ Q ⎞ $10⋅ LQ ˆ ⎜ ⎟ ˆ ˆ ⎜ ⎟⎜ ⎟ = $10⋅λ ⋅ wQ = ⎝ hour ⎠⎝ customer ⎠ hour • Server may also impose costs on the system, if a group of c parallel servers (1 ≤ c ≤ ∞) have utilization ρ, each server imposes a cost of $5 per hour while busy. • The to ta l server cost is: $5⋅c ⋅ ρ

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.39 Steady-state Behavior of Infinite- Population Markovian Models

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.40 Steady-State Behavior of Markovian Models

• Markovian models: • Exponential-distributed arrival process (mean arrival rate = 1/λ). • Service times may be exponentially (M) or arbitrary (G) distributed. • Queue discipline is FIFO. • A queueing system is in statistical equilibrium if the probability that the system is in a given state is not time dependent:

P(L(t) = n) = Pn (t) = Pn

• Mathematical models in this chapter can be used to obtain approximate results even when the model assumptions do not strictly hold, as a rough guide. • Simulation can be used for more refined analysis, more faithful representation for complex systems.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.41 Steady-State Behavior of Markovian Models

• Properties of processes with statistical equilibrium • The state of statistical eqqyguilibrium is reached from any starting state. • The process remains in statistical equilibrium once it has reached it.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.42 Steady-State Behavior of Markovian Models

• For the simple model studied in this chapter, the steady- state parameter, L, the time-average number of customers in the system is: ∞ L = ∑nPn n=0

• Apply Little’s equation, L=λ w, to the whole system and to the queue alone: L 1 w = , w = w − , L = λw λ Q μ Q Q • G/G/c/∞/∞ example: to have a statistical equilibrium, a necessary and sufficient condition is: λ ρ = <1 cμ

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.43 M/G/1 Queues

• Single-server queues with Poisson arrivals and unlimited capacity. • Suppose service times have mean 1/μ and variance σ 2 and ρ = λ / μ < 1, the steady-state parameters of M/G/1 queue: λ ρ = μ

P0 =1− ρ ρ 2 (1+σ 2μ 2 ) The particular L = ρ + distribution is not 2(1− ρ) known! 1 λ(1/ μ 2 +σ 2 ) w = + μρ 2(1−ρ ) 2 σ 2 2 (1+ μ ) ρ server utilization LQ = ρ P probability of empty system λ 2(1− ) 0 μ L long-run time-average number of customers in system (1/ 2 +σ 2 ) w long-run average time spent in system per customer L long-run time-average number of customers in queue wQ = Q 2(1− ρ) wQ long-run average time spent in queue per customer

Prof. Dr. Mesut Güneş▪Ch. 8 Queueing Models 8.44 M/G/1 Queues

• There are no simple expressions for the steady-state probabilities P0, P1, P2 ,…

• L – LQ = ρ is the time-average number of customers being served.

• Average length of queue, LQ, can be rewritten as:

ρ 2 λ2σ 2 L = + Q 2(1− ρ) 2(1− ρ)

2 • If λ and μ are held constant, LQ depends on the variability, σ , of the service times.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.45 M/G/1 Queues • Example: Two workers competing for a job, Able claims to be faster than Baker on average, but Baker claims to be more consistent, • Poisson arrivals at rate λ = 2 per hour (1/30 per minute). • Able: 1/μ = 24 minutes and σ 2 = 202 = 400 minutes2:

(1/ 30)2[242 + 400] L = = 2.711 customers Q 2(1− 4 / 5)

• The proportion of arrivals who find Able idle and thus experience no delay is P0 = 1-ρ = 1/5 = 20%.

• Baker: 1/μ = 25 minutes and σ 2 = 22 = 4 minutes2: (1/ 30)2[252 + 4] L = = 2.097 customers Q 2(1− 5/ 6)

• The proportion of arrivals who find Baker idle and thus experience no delay is P0 =1-ρ = 1/6 = 16.7%.

• Although working faster on average, Able’s greater service variability results in an average queue length about 30% greater than Baker’s.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.46 M/M/1 Queues

• Suppose the service times in an M/G/1 queue are exponentially distributed with mean 1/μ, then the variance is σ 2 = 1/μ2. • M/M/1 queue is a useful approximate model when service times have standard deviation approximately equal to their means. • The steady-state parameters 0,35 0,30 M/M/1 Queue Pn λ ρ = 0,25 μ 0,20 0,15 P = ()1−ρ n n ρ P0 =1− ρ 0,10 λ ρ 0,05 L = = μ − λ 1− ρ 0000,00 μ 13579111315171921 1 λ 1 w = = μ λ− (1− ρ) ρ server utilization μ 2 2 μ ρ P0 probability of empty system λ LQ = = L long-run time-average number of customers in system ()− 1− ρ w long-run average time spent in system per customer λ ρ LQ long-run time-average number of customers in queue wQ = μ μ = μ w long-run average time spent in queue per customer ( − λ) (1− ρ) Q

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.47 M/M/1 Queues

• Single-chair unisex hair-styling shop • Interarrival and service times are exponentially distributed • λ = 2 customers/hour and µ = 3 customers/hour ρ λ 2 = = λ 2 L = μ = = 2 Customers μ 3 − λ 3− 2 1 L 2 P0 =1− ρ = w = = =1 hour 3 λ 2 1 1 ⎛ 2 ⎞ 2 1 1 2 P1 = ⋅⎜ ⎟ = w = w − =1− = hour 3 ⎝ 3 ⎠ 9 Q μ 3 3 2 1 ⎛ 2 ⎞ 4 λ2 4 4 P2 = ⋅⎜ ⎟ = LQ = = = Customers 3 ⎝ 3 ⎠ 27 μ(μ − λ) 3(3− 2) 3 3 16 λ 4 2 L = L + = + = 2 Customers P≥4 =1− ∑ Pn = Q n=0 81 μ 3 3

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.48 M/M/1 Queues • Example: M/M/1 queue with service rate μ =10 λ 567.28.6410 customers per hour. ρ 0.5 0.60 0.72 0.864 1 • Consider how L and w increase L 1.0 1.50 2.57 6.350 ∞ as arrival rate, λ, increases w 0.2 0.25 0.36 0.730 ∞ from 5 to 8.64 by increments 20 of 20% L 18 w

16 • If λ/μ ≥ 1, waiting lines tend to 14 continually grow in length 12

f Customers 10 oo 8

• Increase in average system Number 6 time (w) and average number 4 in system (L) is highl y 2 0 nonlinear as a function of ρ. 0.5 0.6 0.7 0.8 0.9 1 rho

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.49 Effect of Utilization and Service Variability

• For almost all queues, if lines are too long, they can be reduced by decreasing server utilization (ρ) or by decreasing the service time variability (σ2). • A measure of the variability of a distribution: • coefficient of variation (cv):

V (X ) (cv)2 = []E(X ) 2

• The larger cv is, the more variable is the distribution relative to its expected value • For exponential service times with rate µ • E(X) = 1/µ • V(X) = 1/µ2 ¨ cv = 1

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.50 Effect of Utilization and Service Variability

• Consider LQ for any For any M/G/1 M/G/1 queue: (cv)2 = σ2/(1/µ)2= σ2µ2 ρ 2 (1+σ 2μ 2 ) L = Q 2(1− ρ) ⎛ρ 2 ⎞⎛1+ (cv)2 ⎞ = ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎝1− ρ ⎠⎝ 2 ⎠

LQ for M/M/1 Corrects the M/M/1 queue formula to account for a non-exponential service time dist’n

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.51 Multiserver Queue: M/M/c

• M/M/c/∞/∞ queue: c servers operating in parallel • Arrival process is poisson with rate λ • Each server has an independent and identical exponential service- time distribution, with mean 1/μ. • To achieve statistical eqq,uilibrium, the offered load ( λ/μ))y must satisfy λ/μ < c, where λ/(cµ)=ρ is the server utilization.

λ Calling population 1

Waiting line 2

c

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.52 Multiserver Queue: M/M/c

• The steady-state parameters for M/M/c

ρ λ = cμ −1 c ⎧ c−1 n ⎫ ⎪⎡ λ ( / ) ⎤ ⎡⎛ ⎞ ⎛ 1 ⎞⎛ c ⎞⎤⎪ P0 = ⎨⎢ μ ⎥ + ⎢⎜ ⎟ ⎜ ⎟⎜ ⎟⎥⎬ ∑ n! ⎜ ⎟ c! ⎜ c − ⎟ ⎩⎪⎣n=0 ⎦ λ⎣⎢⎝ ⎠ ⎝ ⎠⎝ ⎠⎦⎥⎭⎪ Probability that ρ c ρ all servers are (cρ) P μ P(L(∞) ≥ c)= 0 μ busy c!(1− ρ) μ ρ ρ ρ λ (c )c+1 P ⋅ P()L(∞) ≥ c L = c + 0 = c + c(c!)(1− )2 1− ρ L wλ= ρ ⋅ P()L(∞) ≥ c L = Q 1− ρ L − LQ = cρ

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.53 Multiserver Queue: M/M/c

Probability of empty system Probability of empty system log scale on y axis

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.54 Multiserver Queue: M/M/c

Probability of empty system Number of customers in system

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.55 Multiserver Queue: Common Models

• Other common multiserver queueing models

⎛ ρ 2 ⎞⎛1+ (cv)2 ⎞ ⎜ ⎟⎜ ⎟ LQ = ⎜ ⎟⎜ ⎟ ⎝1− ρ ⎠⎝ 2 ⎠

L for M/M/1 Corrects the M/M/1 Q formula queue

• M/G/c/∞: general service times and c parallel server. The pppparameters can be approximated from those of the M/M/c/∞/∞ model. • M/G/∞: general service times and infinite number of servers. • M/M/c/N/∞: service times are exponentially distributed at rate μ and c servers where the total system capacity is N ≥ c customer. When an arrival occurs and the system is full, that arrival is turned away.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.56 Multiserver Queue: M/G/∞ • M/G/∞: general service times and infinite number of servers • customer is its own server • service capacity far exceeds service demand • when we want to know how many servers are required so that customers are rarely delayed

λ n −λ ( ) P = e μ μ ,n = 0,1, n n! K λ − μ P0 = e 1 w = μ

wQ = 0 λ L = μ

LQ = 0

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.57 Multiserver Queue: M/G/∞ • How many users can be logged in simultaneously in a computer system • Customers log on with rate λ = 500 per hour • Stay connected in average for 1/µ =180 minutes = 3 hours • For planning purposes it is pretended that the simultaneous logged in users is infinite • Expected number of simultaneous users L λ L = = 500⋅3 =1500 μ

• To ensure providing adequate capacity 95% of the time, the number of parallel users c has to be restricted c c e−1500 (1500)n P(L(∞) ≤ c) = ∑ Pn = ∑ ≥ 0.95 n=0 n=0 n! • The capacity c =1564 simultaneous users satisfies this requirement

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.58 Multiserver Queue with Limited Capacity

• M/M/c/N/∞: service times are exponentially distributed at rate μ and c servers where the total system capacity is N ≥ c customer • When an arrival occurs and the system is full, that arrival is turned away

• Effective arrival rate λe is defined as the mean number of arrivals per time unit who enter and remain in the system

−1 λ ⎡ c an ac N ⎤ a = n−c P0 = ⎢1+ ∑∑+ ρ ⎥ μ ⎣ n=+11n! c! n=c ⎦ λ a N ρ = PN = N −c P0 cμ c!c P ac ρ L = 0 (1− ρ N −c − (N − c)ρ N −c (1− ρ)) Q c!(1− ρ) λ e = λ(1− PN )

LQ wQ = λ (1 - PN) probabilit y th at a e customer will find a 1 w = w + space and be able to Q μ enter the system

L = λew

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.59 Multiserver Queue with Limited Capacity

Single-chair unisex hair-styling shop (again!) • Space only for 3 customers: one • Queue time

in service and two waiting LQ 28 wQ = = = 0.246 • First compute P0 λe 114 1 P = = 0.415 System time, time in shop 0 n−1 • ⎡ 2 2 3 ⎛ 2 ⎞ ⎤ ⎢1+ + ⎜ ⎟ ⎥ 3 3 ∑ 3 1 66 ⎣⎢ n=2 ⎝ ⎠ ⎦⎥ w = w + = = 0.579 Q μ 114 • P(system is full) (2 )3 8 P = P = 3 P = = 0.123 • Expected number of customers N 3 1!12 0 65 in shop 66 • Average of the queue L = λ w = =1.015 e 65 LQ = 0.431 • Probability of busy shop • Effective arrival rate λ 1− P = e = 0.585 ⎛ 8 ⎞ 114 0 μ λe = 2⎜1− ⎟ = =1.754 ⎝ 65 ⎠ 65

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.60 Steady-state Behavior of Finite-Population Models

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.61 Steady-State Behavior of Finite-Population Models

• In practical problems calling population is finite • When the calling population is small, the presence of one or more customers in the system has a strong effect on the distribution of future arrivals. • Consider a finite-calling population model with K customers (M/M/c/K/K) • The time between the end of one service visit and the next call for service is exponentially distributed with mean = 1/λ. • Service times are also exponentially distributed with mean 1/µ. • c parallel servers and system capacity is K.

K Customers Mean runtime 1 1/λ Waiting line with capacity K-c 2

c

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.62 Steady-State Behavior of Finite-Population Models

• Some of the steady-stateλ probabilities of M/M/c/K/K : μ

n n −1 ⎡ c−1 ⎛ K ⎞⎛ ⎞ K K! ⎛λ ⎞ ⎤ P = ⎢ ⎜ ⎟⎜ ⎟ + ⎜ ⎟ ⎥ 0 ∑⎜ n ⎟⎜ ⎟ ∑ n−c ⎜ ⎟ ⎣⎢n=0 ⎝ ⎠⎝ ⎠ n=c (K − n)!c!c ⎝ μ ⎠ ⎦⎥ n ⎧⎛ K ⎞⎛μλ ⎞ ⎪⎜ ⎟⎜ ⎟ P0 , n = 0,1,...,c −1 ⎪⎝ n ⎠⎝ ⎠ Pn = ⎨ n K! ⎛ λ ⎞ ⎪ ⎜ ⎟ , n = c,c +1,...K ⎪(K − n)!c!cn−c ⎜ μ ⎟ ⎩ ⎝λ ⎠ K ρ λ e L = ∑ nPn , w = L / e , = n=0 cμ

where λ is the long run effective arrival rate of customers to queue (or entering/exiting service) e λ K e = ∑(K − n)λPn n=0

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.63 Steady-State Behavior of Finite-Population Models • Example: two workers who are responsible for 10 milling machines. • Machines run on the average for 20 minutes, then require an average 5-minute service period, both times exponentially distributed: λ = 1/20 and μ = 1/5.

• All of the performance measures depend on P0:

n n −1 ⎡ 2−1 ⎛10⎞⎛ 5 ⎞ 10 10! ⎛ 5 ⎞ ⎤ P = ⎜ ⎟ + = 0.065 0 ⎢∑⎜ ⎟⎜ ⎟ ∑ n−2 ⎜ ⎟ ⎥ ⎣⎢n=0 ⎝ n ⎠⎝ 20 ⎠ n=2 (10 − n)!2!2 ⎝ 20 ⎠ ⎦⎥

• Then, we can obtain the other Pn, and can compute the expected number of machines in system: 10 L = ∑nPn = 3.17 machines n=0 • The average number of running machines:

K − L = 10 − 3.17 = 6.83 machines

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.64 Networks of Queues

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.65 Networks of Queues

• No simple notation for networks of queues • Two types of networks of q ueues • Open queueing network • External arrivals and departures • Numbfber of customers in system varies over time • Closed queueing network • No external arrivals and departures • Number of customers in system is constant

Out Out In In

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.66 Networks of Queues • Many systems are modeled as networks of single queues • Customers departing from one queue may be routed to another

λi λj=λipij Out i j In

• The followinggy results assume a stable system with infinite calling population and no limit on system capacity: • Provided that no customers are created or destroyed in the queue, then the departure rate out of a queue is the same as the arrival rate into the queue, over the long run.

• If customers arrive to queue i at rate λi, and a fraction 0 ≤ pij ≤ 1 of them are routed to queue j upon departure, then the arrival rate from queue i to queue j is λj =λi pij over the long run.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.67 Networks of Queues

• The overall arrival rate into queue j:

λ j = a j + ∑λi pij all i Arrival rate Sum of arrival rates from outside fthifrom other queues in the network network

• If queue j has cj < ∞ parallel servers, each working at rate μj, then the long-run utilization of each server is: (where ρj < 1 for stable queue). λ j ρ j = c j μ j • If arrivals from outside the network form a Poisson process with rate

aj for each queue j, and if there are cj identical servers delivering exponentia lly distr ibute d serv ice t imes w it h mean 1/μ , then, in λ j steady state, queue j behaves likes an M/M/cj queue with arrival rate j = a j + ∑λi pij all i

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.68 Network of Queues

• Discount store example: 0.4 c = ∞ • Suppose customers 80 Cust. Customer c = 1 arrive at the rate 80 per Population hour hour and 40% choose self-service. 0.6

• Hence:

• Arrival rate to service center 1 is λ1 = 80(0.4) = 32 per hour

• Arrival rate to service center 2 is λ2 = 80(()0.6) = 48 per hour.

• c2 = 3 clerks and μ2 = 20 customers per hour. • The long-run utilization of the clerks is:

ρ2 = 48/(3×20) = 0.8 • All customers must see the cashier at service center 3, the overall rate to

service center 3 is λ3 = λ1 + λ2 = 80 per hour.

• If μ3 = 90 per hour, then the utilization of the cashier is:

ρ3 = 80/90 = 0.89

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.69 Summary

• Introduced basic concepts of queueing models. • Showed how simulation, and sometimes mathematical analysis, can be used to es tima te the perf ormance measures of a syst em.

• Commonly used performance measures: L, LQ, w, wQ, ρ, and λe. • When simulating any system that evolves over time, analyst must decide whether to study transient or steady-state behavior. • Simple formulas exist for the steady-state behavior of some queues. • Simppy,le models can be solved mathematically, and can be useful in providing a rough estimate of a performance measure.

Prof. Dr. Mesut Güneş ▪ Ch. 8 Queueing Models 8.70