Queueing Theory Frank Y S Lin Information Management

  • Slides: 50
Download presentation
Queueing Theory Frank Y. S. Lin Information Management Dept. National Taiwan University yslin@im. ntu.

Queueing Theory Frank Y. S. Lin Information Management Dept. National Taiwan University yslin@im. ntu. edu. tw 1

References n n Leonard Kleinrock, “Queueing Systems Volume I: Theory”, New York: Wiley, 1975

References n n Leonard Kleinrock, “Queueing Systems Volume I: Theory”, New York: Wiley, 1975 -1976. D. Gross and C. M. Harris, “Fundamentals of Queueing Theory”, New York: Wiley, 1998. 2

Agenda n n n n Introduction Stochastic Process General Concepts M/M/1 Model M/M/1/K Model

Agenda n n n n Introduction Stochastic Process General Concepts M/M/1 Model M/M/1/K Model Discouraged Arrivals M/M/∞ and M/M/m Models M/M/m/m Model 3

Introduction 4

Introduction 4

Queueing System n A queueing system can be described as customers arriving for service,

Queueing System n A queueing system can be described as customers arriving for service, waiting for service if it is not immediate, and if having waited for service, leaving the system after being served. 5

Why Queueing Theory n Performance Measurement n n n Average waiting time of customer

Why Queueing Theory n Performance Measurement n n n Average waiting time of customer / distribution of waiting time. Average number of customers in the system / distribution of queue length / current work backlog. Measurement of the idle time of server / length of an idle period. Measurement of the busy time of server / length of a busy period. System utilization. 6

Why Queueing Theory (cont’d) n Delay Analysis Network Delay = Queueing Delay + Propagation

Why Queueing Theory (cont’d) n Delay Analysis Network Delay = Queueing Delay + Propagation Delay (depends on the distance) + Node Delay Processing Delay (independent of packet length, e. g. header CRC check) Adapter Delay (constant) 7

Characteristics of Queueing Process n Arrival Pattern of Customers n n Probability distribution Patient

Characteristics of Queueing Process n Arrival Pattern of Customers n n Probability distribution Patient / impatient (balked) arrival Stationary / nonstationary Service Patterns n n n Probability distribution State dependent / independent service Stationary / nonstationary 8

Characteristics of Queueing Process (cont’d) n Queueing Disciplines n n n First come, first

Characteristics of Queueing Process (cont’d) n Queueing Disciplines n n n First come, first served (FCFS) Last come, first served (LCFS) Random selection for service (RSS) Priority queue Preemptive / nonpreemptive System Capacity n Finite / infinite waiting room. 9

Characteristics of Queueing Process (cont’d) n Number of Service Channels n n n Single

Characteristics of Queueing Process (cont’d) n Number of Service Channels n n n Single channel / multiple channels Single queue / multiple queues Stages of Service n n n Single stage (e. g. hair-styling salon) Multiple stages (e. g. manufacturing process) Process recycling or feedback 10

Notation n A queueing process is described by A/B/X/Y/Z 11

Notation n A queueing process is described by A/B/X/Y/Z 11

Notation (cont’d) n n For example, M/D/2/∞/FCFS indicates a queueing process with exponential inter-arrival

Notation (cont’d) n n For example, M/D/2/∞/FCFS indicates a queueing process with exponential inter-arrival time, deterministic service times, two parallel servers, infinite capacity, and first-come, firstserved queueing discipline. Y and Z can be omitted if Y = ∞ and Z = FCFS. 12

Stochastic Process 13

Stochastic Process 13

Stochastic Process n Stochastic process: any collection of random variables Χ(t), t T, on

Stochastic Process n Stochastic process: any collection of random variables Χ(t), t T, on a common probability space where t is a subset of time. n n Continuous / discrete time stochastic process Example: Χ(t) denotes the temperature in the class on t = 7: 00, 8: 00, 9: 00, 10: 00, … (discrete time) We can regard a stochastic process as a family of random variables which are “indexed” by time. For a random process X(t), the PDF is denoted by FX(x; t) = P[X(t) <= x] 14

Some Classifications of Stochastic Process n Stationary Processes: independent of time FX (x; t

Some Classifications of Stochastic Process n Stationary Processes: independent of time FX (x; t + τ) = FX (x; t) n Independent Processes: independent variables FX (x; t) = FX 1, …, Xn(x 1, …, xn ; t 1, …, tn) = FX 1(x 1; t 1) …FXn(xn; tn) n Markov Processes: the probability of the next state depends only upon the current state and not upon any previous states. P[X(tn+1) = xn+1 | X(tn) = xn, …. , X(t 1) = x 1] = P[X(tn+1) = xn+1 | X(tn) = xn] 15

Some Classifications of Stochastic Process (cont’d) n Birth-death Processes: state transitions take place between

Some Classifications of Stochastic Process (cont’d) n Birth-death Processes: state transitions take place between neighboring states only. n Random Walks: the next position the process occupies is equal to the previous position plus a random variable whose value is drawn independently from an arbitrary distribution. 16

General Concepts 17

General Concepts 17

Continuous-time Memoryless Property If X ~Exp(λ), for any a, b > 0, P [X

Continuous-time Memoryless Property If X ~Exp(λ), for any a, b > 0, P [X > a + b | X > a ] = P [X > b ] Proof: P[X > a + b | X > a] 18

Global Balance Equation n Define Pi = P[system is in state i] Pij =

Global Balance Equation n Define Pi = P[system is in state i] Pij = P[get into state j right after leaving state i] rate out of state j = rate into state j 19

General Balance Equation n Define S = a subset of the state space S

General Balance Equation n Define S = a subset of the state space S j rate in = rate out 20

General Equilibrium Solution n Notation: n n n Pk = the probability that the

General Equilibrium Solution n Notation: n n n Pk = the probability that the system contains k customers (in state k) λk= the arrival rate of customers when the system is in state k. μk= the service rate when the system is in state k. 21

General Equilibrium Solution (cont’d) n Consider state k: λk λk-1 k μk k+1 μk+1

General Equilibrium Solution (cont’d) n Consider state k: λk λk-1 k μk k+1 μk+1 . . . # 22

General Equilibrium Solution (cont’d) 23

General Equilibrium Solution (cont’d) 23

Little’s Result = average number of customers in the system n T = system

Little’s Result = average number of customers in the system n T = system time (service time + queueing time) n λ= arrival rate n Black box Service time … Queueing time System time T 24

M/M/1 Model Single Server, Single Queue (The Classical Queueing System) 25

M/M/1 Model Single Server, Single Queue (The Classical Queueing System) 25

M/M/1 Queue n Single server, single queue, infinite population: n Interarrival time distribution: n

M/M/1 Queue n Single server, single queue, infinite population: n Interarrival time distribution: n Service time distribution n Stability condition λ < μ 26

M/M/1 Queue (cont’d) n n System utilization Define state Sn = n customers in

M/M/1 Queue (cont’d) n n System utilization Define state Sn = n customers in the system (n-1 in the queue and 1 in service) S 0 = empty system rate out S rate in 27

M/M/1 Queue (cont’d) n Define pn = P[n customers in the system] (rate in

M/M/1 Queue (cont’d) n Define pn = P[n customers in the system] (rate in = rate out) Since # 28

M/M/1 Queue (cont’d) n Average number of customers in the system # 29

M/M/1 Queue (cont’d) n Average number of customers in the system # 29

M/M/1 Queue (cont’d) n Average system time (Little’s Result) # n P[≧ k customers

M/M/1 Queue (cont’d) n Average system time (Little’s Result) # n P[≧ k customers in the system] 30

M/M/1/K Model Single Server, Finite Storage 31

M/M/1/K Model Single Server, Finite Storage 31

M/M/1/K Model n The system can hold at most a total of K customers

M/M/1/K Model n The system can hold at most a total of K customers (including the customer in service) λk = λ 0 if k < K if k K μk = μ 32

M/M/1/K Model (cont’d) 33

M/M/1/K Model (cont’d) 33

Discouraged Arrivals 34

Discouraged Arrivals 34

Discouraged Arrivals n Arrivals tend to get discouraged when more and more people are

Discouraged Arrivals n Arrivals tend to get discouraged when more and more people are present in the system. 35

Discouraged Arrivals (cont’d) 36

Discouraged Arrivals (cont’d) 36

Discouraged Arrivals (cont’d) 37

Discouraged Arrivals (cont’d) 37

M/M/∞ and M/M/m M/M/∞ - Infinite Servers, Single Queue (Responsive Servers) M/M/m - Multiple

M/M/∞ and M/M/m M/M/∞ - Infinite Servers, Single Queue (Responsive Servers) M/M/m - Multiple Servers, Single Queue (The m-Server Case) 38

M/M/∞ Queue n There is always a new server available for each arriving customer.

M/M/∞ Queue n There is always a new server available for each arriving customer. 39

M/M/∞ Queue (cont’d) (Little’s Result) 40

M/M/∞ Queue (cont’d) (Little’s Result) 40

M/M/m Queue n The M/M/m queue n n n An M/M/m queue is shorthand

M/M/m Queue n The M/M/m queue n n n An M/M/m queue is shorthand for a single queue served by multiple servers. Suppose there are m servers waiting for a single line. For each server, the waiting time for a queue is a system with service rateμ and arrival rate λ/m. The M/M/1 analysis has been done, at risk conclusion: delay = throughput 41

M/M/m Queue (cont’d) λk = λ μk = kμ if k m mμ if

M/M/m Queue (cont’d) λk = λ μk = kμ if k m mμ if k > m For k > m 42

M/M/n Queue (cont’d) ∴ P[queueing] = Total system time = 43

M/M/n Queue (cont’d) ∴ P[queueing] = Total system time = 43

Comparisons (cont’d) n M/M/1 v. s M/M/4 If we have 4 M/M/1 systems: 4

Comparisons (cont’d) n M/M/1 v. s M/M/4 If we have 4 M/M/1 systems: 4 parallel communication links that can each handle 50 pps (μ), arrival rate λ = 25 pps per queue. average delay = 40 ms. Whereas for an M/M/4 system, average delay = 21. 7 ms. 44

Comparisons (cont’d) n Fast Server v. s A Set of Slow Servers #1 If

Comparisons (cont’d) n Fast Server v. s A Set of Slow Servers #1 If we have an M/M/4 system with service rate μ=50 pps for each server, and another M/M/1 system with service rate 4μ = 200 pps. Both arrival rate is λ = 100 pps delay for M/M/4 = 21. 7 ms delay for M/M/1 = 10 ms 45

Comparisons (cont’d) n Fast Server v. s A Set of Slow Servers #2 If

Comparisons (cont’d) n Fast Server v. s A Set of Slow Servers #2 If we have n M/M/1 system with service rate μ pps for each server, and another M/M/1 system with service rate nμ pps. Both arrival rate is nλ pps S 1 λ μ S 2 nλ nμ … λ μ 46

M/M/m/m Multiple Servers, No Storage (m-Server Loss Systems) 47

M/M/m/m Multiple Servers, No Storage (m-Server Loss Systems) 47

M/M/m/m n There available m servers, each newly arriving customers is given a server,

M/M/m/m n There available m servers, each newly arriving customers is given a server, if a customers arrives when all servers are occupied, that customer is lost e. g. telephony system. 48

M/M/m/m (cont’d) 49

M/M/m/m (cont’d) 49

M/M/m/m (cont’d) n n n Let pm describes the fraction of time that all

M/M/m/m (cont’d) n n n Let pm describes the fraction of time that all m servers are busy. The name given to this probability expression is Erlang’s loss formula and is given by This equation is also referred to as Erlang’s B formula and is commonly denoted by B(m, λ/μ) http: //www. erlang. com 50