Queueing
Queueing
Systems
Systems
Modeling and Performance Evaluation
Modeling and Performance Evaluation
with Computer Science
with Computer Science
Spring, 2003 Spring, 2003 Dr. Eric Hsiao
Dr. Eric Hsiao--kuangkuang WuWu http://
What is going to be covered?
What is going to be covered?
(
Course Outline
Course Outline
•
• ProbabilityProbability
–
– Discrete/Continuous random variableDiscrete/Continuous random variable –
– Conditional ProbabilityConditional Probability
•
• Queuing ModelingQueuing Modeling
–
– M/M/1/kM/M/1/k –
– Bulk Service, Bulk ArrivalBulk Service, Bulk Arrival –
– M/G/1M/G/1 –
– G/G/1G/G/1
•
• Case Studies:Case Studies:
–
Lecture Progress
Lecture Progress
(February, 2003)
(February, 2003)
•
• QueueingQueueing SystemsSystems
–
– System FlowSystem Flow –
– Specification and Measure of Specification and Measure of QueueingQueueing System
System
•
• Notation and Structure for Basic Notation and Structure for Basic Queueing
Queueing SystemsSystems •
• Probability Z transformProbability Z transform •
Daily Experiences
Daily Experiences
•
• Waiting in Line:Waiting in Line:
–
– Waiting for breakfastWaiting for breakfast –
– Stopped at a traffic lightStopped at a traffic light –
– Slowed down on the freewaysSlowed down on the freeways –
– Delayed at the entrance to parking facilityDelayed at the entrance to parking facility –
– Queued for access to an elevatorQueued for access to an elevator –
Systems of Flow
Systems of Flow
•
• QueueingQueueing Systems Systems
–
– Systems of flowSystems of flow
•
• A flow system is one in which some A flow system is one in which some
commodity flows, moves, or is transferred
commodity flows, moves, or is transferred
through one or more finite
through one or more finite--capacity channels capacity channels in order to go from one point to another
in order to go from one point to another
•
• Commodity: (produce the demand)Commodity: (produce the demand)
–
– Such as packet massage, telephone message, Such as packet massage, telephone message, automobiles
automobiles
•
• Channel: (provide the service)Channel: (provide the service)
–
Service and Demand
Service and Demand
the arrival rate R the service rate (or capacity) C
Steady and Unsteady Flow
Steady and Unsteady Flow
•
• Whether the flow is steady or Whether the flow is steady or unsteady?
unsteady?
–
– Steady: those systems in which the flow Steady: those systems in which the flow proceeds in a predictable fashion
proceeds in a predictable fashion
–
– If R<C, a reliable and smooth fashionIf R<C, a reliable and smooth fashion –
– If R>C, the mean capacity is less than the If R>C, the mean capacity is less than the average flow requirements, chaotic
average flow requirements, chaotic
congestion occur
History of Computer Using
History of Computer Using
•
• Single UserSingle User •
• BatchBatch •
• TimeTime--SharingSharing •
• Sharing Communication lineSharing Communication line •
Modeling
Modeling
Mathematical Model of Real World Real World Verification Approximate solution Solution to the ModelResource Sharing
Resource Sharing
•
• A resource is a device that can do A resource is a device that can do works for you at a finite time
works for you at a finite time
–
– e.g. A communication Channele.g. A communication Channel –
– e.g. A computere.g. A computer
•
• A demand requires work from resourceA demand requires work from resource
–
– e.g. message e.g. message –
User Behavior
User Behavior
Bursty
Bursty
Asynchronous
Asynchronous
Demands
Demands
•
• You cannot predict exactly You cannot predict exactly whenwhen they they will demand access
will demand access
•
• You cannot predict exactly You cannot predict exactly how muchhow much they will demand access
they will demand access
•
• Most of timeMost of time they do not need access to they do not need access to resource
resource
•
• When they ask for it, they want When they ask for it, they want immediate
Typical Traffic
Typical Traffic
Interactive Traffic
Short Response time Reliable Transmit
Real Time traffic
Resource Sharing
Resource Sharing
•
• Type1: Everyone use his resource Type1: Everyone use his resource singlely
singlely (not efficient).(not efficient). •
• Type2: Using Pool of resource sharing Type2: Using Pool of resource sharing those resources (by switching) plus the
those resources (by switching) plus the
cost of switch
cost of switch
•
• Type3: Using a large resource (as an Type3: Using a large resource (as an unit).
Law of Large Number
Law of Large Number
•
• The first resource sharing principleThe first resource sharing principle •
• Although each member of a Large population Although each member of a Large population may behave in a Random fashion, the
may behave in a Random fashion, the
population as a whole behave in a
population as a whole behave in a
predictable fashion.
predictable fashion.
–
– This is the This is the ““smoothing smoothing ““ effect of large populationeffect of large population –
– The predictable The predictable fahsionfahsion presents a total demand presents a total demand equal to the sum of the average demands of each
equal to the sum of the average demands of each
member
Conflict Resolution
Conflict Resolution
•
• QueueingQueueing: one gets severed, others : one gets severed, others wait
wait
•
• Splitting: Each get a piece of resourceSplitting: Each get a piece of resource •
• Blocking: One get served, all others are Blocking: One get served, all others are refused
refused
•
Response Time
Response Time
•
• When the throughput and capacity go When the throughput and capacity go up, the response time will go down
up, the response time will go down
•
• Economy of ScaleEconomy of Scale
–
– The second resource sharing principleThe second resource sharing principle –
– if you scale up throughput and capacity by if you scale up throughput and capacity by some factor F, then you reduce response
some factor F, then you reduce response
time by the factor
Economy of Scale
Economy of Scale
DATA
Original: B Block/sec Cbit/sec Scale: NB Block/sec NC bit/sec
Throughput, Efficiency,
Throughput, Efficiency,
Response time
Response time
•
• If you scale the capacity more slowly If you scale the capacity more slowly
than throughput while holding response
than throughput while holding response
time constant, then efficiency will
time constant, then efficiency will
increase
increase
•
• Key tradeoff among:Key tradeoff among:
–
System of Flow
System of Flow
•
• Flow of a commodity (demand) through Flow of a commodity (demand) through a finite
a finite--capacity channel (resource)capacity channel (resource)
–
– Steady FlowSteady Flow –
Steady Flow
Steady Flow
•
• Demand are known, constant smooth: Demand are known, constant smooth: predictable
predictable
•
• Single Channel:Single Channel:
–
– R = Arrival Rate (Cans/Sec)R = Arrival Rate (Cans/Sec) –
– C = Capacity (Cans/Sec)C = Capacity (Cans/Sec) –
– if R <= C Fineif R <= C Fine –
Network of Channels
Network of Channels
•
• MaxMax--Flow MinFlow Min--Cut TheoremCut Theorem
•
• R < C for each channelR < C for each channel •
• MaxmumMaxmum Flow , label the node, find a Flow , label the node, find a path
path Taipei
Unsteady Flow(I)
Unsteady Flow(I)
•
• Arrival time of Demand: Arrival time of Demand: UnpredicatbleUnpredicatble •
• SiseSise (Service time) of Demand: (Service time) of Demand: Unpredictable
Unpredictable
•
• Single Channel:Single Channel:
–
– Queue LengthQueue Length –
– Waiting TimeWaiting Time –
– Sever UtilizationSever Utilization –
– Throughput Throughput –
Unsteady Flow(II)
Unsteady Flow(II)
•
• Network of ChannelNetwork of Channel
–
– capacitycapacity –
– throughputthroughput –
– Response TimeResponse Time –
– EfficiencyEfficiency –
– design
Combinatonics and probablities kill you
General
General
Queueing
Queueing
System
System
Queueing System
•
• How to improve the system How to improve the system performance
Review of
Review of
Queueing
Queueing
•
• QueueingQueueing SystemsSystems
–
– NotationNotation –
– MarkovianMarkovian Queue, BirthQueue, Birth--andand--deathdeath –
– M/M/1 M/M/1 --> M/M/k/m> M/M/k/m –
– Stage Stage --> > ErlangianErlangian distributiondistribution –
– ParallelParallel –
– Network of QueueNetwork of Queue –
limited resouce (fixed number of queue size buffer N
How often they arrive
how long they will stay
What we are interested ?
What we are interested ?
•
• How long we are going to wait ?How long we are going to wait ? •
• How big the queue size should How big the queue size should be ?
Observation 1
Observation 1
•
• Each customer could be Each customer could be
characterized as the following:
characterized as the following:
–
– how often the traffic produced ?how often the traffic produced ? –
– how many service it may require ?how many service it may require ?
Observation 2
Observation 2
•
• Some users might be in the queue ?Some users might be in the queue ?
Observation
Observation
•
• Current State depends on Previous Current State depends on Previous State
State
Ν(τ)
Computer Queue System
Computer Queue System
•
• MarkovianMarkovian Chain:Chain:
–
– current state depends on previous one current state depends on previous one state only
state only
–
– time domaintime domain
•
• discretediscrete •
• continuouscontinuous
–
– state domain:state domain:
•
• dsicretedsicrete •
Birth
Birth
-
-
Death Process
Death Process
•
• Transitions are Transitions are allowdallowd between between neighbors:
neighbors:
–
– P(k) to P(k+1) P(k) to P(k+1)
•
• birth happen (arrival)birth happen (arrival)
–
– P(k) to P(kP(k) to P(k--1)1)
•
• death happen (death)death happen (death) •
• PossionPossion and and ExponetialExponetial Distributions Distributions are
Μ/Μ/1 0 1 2 3 4 λ λ λ λ µ µ µ µ µ
Number of buffers <-> Number of Customers
Format
Format
•
• M / M / 1 / 2M / M / 1 / 2
number of server
Number of buffer size
Amount of service a customer require B(x) = P[service time <=x]
Arrival Time
Probability
Probability
• • Sum of P(k) = 1Sum of P(k) = 1 • • P(k) <= 1P(k) <= 1 •• E[N] = Sum of E[N] = Sum of K P(k)K P(k) •
General
General
Queueing
Queueing
System
System
•
• C(n) nth customer to enter the systemC(n) nth customer to enter the system •
• N(t) number of customer in the system at N(t) number of customer in the system at time t
time t
•
• a(n) arrival time for C(n)a(n) arrival time for C(n) •
• t(n) t(n) interarrvalinterarrval time between C(ntime between C(n--1) and C(n)1) and C(n) •
• x(n) service time for C(n)x(n) service time for C(n) •
• w(n) waiting time for C(n)w(n) waiting time for C(n) •
Time
Time
-
-
diagram notation
diagram notation
Servicer Queue S(n) W(n) C(n) C(n-1) C(n) C(n+1) t(n) C(n)
Classical M/M/1
Classical M/M/1
Queueing
Queueing
•
• Single Server QueueSingle Server Queue •
• Poisson Arrival ProcessPoisson Arrival Process •
• Exponential Distribution for service timeExponential Distribution for service time •
M/M/1 Analysis
M/M/1 Analysis
•
• StateState--transitiontransition--rate diagramrate diagram
a a
0 1 2 n
What you should need for
What you should need for
Queueing
Queueing
modeling
modeling
•
• Probability (such as arrival rate, service Probability (such as arrival rate, service rate)
rate)
•
• Transform (zTransform (z--transform, transform, LaplaceLaplace transform)