Docsity

Queueing Theory - Advanced Operating System - Lecture Notes, Study notes of Computer Science

Toggle sidebar
bg1
Notes on Queueing Theory
Page 1 of 3
Queuing theory is the mathematics of waiting lines. It is extremely useful in predicting and evaluating
system performance.
Assumptions:
• independent arrivals
• exponential distributions
• customers do not leave or change queues.
• Large queues do not discourage customers.
Queueing theory usually provides reasonable answers even if the above do not exactly hold. There are
advanced Queueing theory formulas to handle exceptions to all of the above assumptions.
Basic measurable values of a queueing system
• Arrival rate (λ) — the average rate at which customers arrive. Be careful that you measure lambda
in the proper units.
• Service time (s) — the average time required to service one customer. The units for the service
time should be the inverse of the units for arrival rate.
• Number in the system (Q) — the average number of customers in the system, both waiting and
being serviced.
• Number waiting (W) — the average number of customers waiting. Always less than Q.
• Time in the system (Tq) the average time each customer is in the system, both waiting and being
serviced.
• Time waiting (Tw) the average time each customer waits in the queue. Tq = Tw + s
Queueing systems are usually described by three values separated by slashes
Arrival distribution / service distribution / number of servers
where:
M = Markovian or exponentially distributed
D = Deterministic or constant.
G = General or binomial distribution
The most common queueing system is M/M/1 where the arrival rate is exponentially distributed, the
service times are exponentially distributed and there is only one server.
Poisson arrival rate.
If customers are arriving at the exponentially distributed rate λ, then the probability that there will be k
customers after time t is:
t
k
ke
k
t
tP
λ
λ
−
=!
)(
)(
Utilization = ρ = λs = faction of time the server is busy.
Little's formula states the queue size equals the arrival rate times the average time in the system.
q
TQ
λ
=
or W
TW
λ
=
Docsity.com
pf3

Partial preview of the text

Download Queueing Theory - Advanced Operating System - Lecture Notes and more Study notes Computer Science in PDF only on Docsity!

Page 1 of 3

Queuing theory is the mathematics of waiting lines. It is extremely useful in predicting and evaluating system performance.

Assumptions:

  • independent arrivals
  • exponential distributions
  • customers do not leave or change queues.
  • Large queues do not discourage customers.

Queueing theory usually provides reasonable answers even if the above do not exactly hold. There are advanced Queueing theory formulas to handle exceptions to all of the above assumptions.

Basic measurable values of a queueing system

  • Arrival rate (λ) — the average rate at which customers arrive. Be careful that you measure lambda in the proper units.
  • Service time (s) — the average time required to service one customer. The units for the service time should be the inverse of the units for arrival rate.
  • Number in the system (Q) — the average number of customers in the system, both waiting and being serviced.
  • Number waiting (W) — the average number of customers waiting. Always less than Q.
  • Time in the system (Tq) the average time each customer is in the system, both waiting and being serviced.
  • Time waiting (Tw) the average time each customer waits in the queue. Tq = Tw + s

Queueing systems are usually described by three values separated by slashes

Arrival distribution / service distribution / number of servers

where: M = M arkovian or exponentially distributed D = D eterministic or constant. G = G eneral or binomial distribution

The most common queueing system is M/M/1 where the arrival rate is exponentially distributed, the service times are exponentially distributed and there is only one server.

Poisson arrival rate. If customers are arriving at the exponentially distributed rate λ, then the probability that there will be k customers after time t is:

t k k e k

t P t^ λ

Utilization = ρ = λs = faction of time the server is busy.

Little's formula states the queue size equals the arrival rate times the average time in the system.

Q = λ T q or W = λ TW

Page 2 of 3

The simplest server is an M/M/1 queue. Both the service time and the arrival rate are variable and exponentially distributed.

Tq

s

Q

Tw

s

−

ρ −

2 W

For some systems the service time is always the same. These systems can be modeled as a M/D/ queue. In the equations below, note that the wait time (and hence the time in the system) is smaller because there is less variability in the system.

s Tq 2 ( 1 ) 1 2 ( 1 )

2 2

Q =

s Tw 2 ( 1 )

2

W =

When there are N servers, we assume that each server is identical. All customers wait in a single queue and use the first available server. The utilization is ρ = λ s / N. For the calculations, an

intermediate value, K is useful.

=

−

=

N

i i

s

N

i i

s

i

i

K

0!

( )

1

0!

( )

λ

λ

The probability that all servers are busy is

N

sK

K

C

s N

Cs Tq + −

Q C λ s

N

Cs Tw

W C

When working on a problem involving queueing theory, it is advisable to following these steps:

  • Determine what quantities you need to know. Do you need to know the time in the system or just the waiting time?
  • Identify the server. Where are items being queued?
  • Identify the queued items. Are the items being queued: processes, bytes, requests, messages or some other object. Once the item is defined, convert all times and rates into these units. For example, if network packets are being queued, then convert the transmission rate into packets/sec.
  • Identify the queueing model. How many queues and how many servers are involved. Is the service time constant or random?
  • Determine the service time. Calculate the service time in seconds/item.
  • Determine the arrival rate. Calculate the arrival rate from all sources in items/sec.
  • Calculate^ ρ, the server utilization.
  • Calculate the desired values. Make sure you use the correct equation for the appropriate queueing model.