DEV Community

Nishant Modak
Nishant Modak

Posted on

Nobody likes to wait in a Queue

Nobody likes to wait in a queue. Almost everyone in a queue at immigration or in a road traffic has considered

  • What if I move to the other queue? Thats going faster
  • Why haven't they added more servers / units / lanes to service?
  • This is just the bad time of the day. Should have started early.

Its a science! These things can be answered by formulas and you can study these systems formally.

The mathematical field of studying queues is called Queueing Theory.

Queueing Theory 101

Definitions

Queueing Theory Terminology

System Structures

Queueing Systems

Key Concepts

  • Arrivals
    How things arrive? Stream, Batch
    Is there a normal arrival distribution?
    Are the arrival times finite / infinite?

  • Service
    Kind of resources needed to service
    How long does it take ?
    Number of servers available
    How many can be serviced?
    Parallel / Serial?
    Single / Multiple Queues
    Preemption (Priority)

  • Queue Characteristics
    Balking (people/things don't join, if queue is long)
    Reneging (queue too long, leave mid way)
    Jockeying (switch queue)
    Finite / Infinite (queue lengths)

Questions we are interested in

  1. How long does a customer (*request) have to wait
  2. What is the probability of customer having to wait longer
  3. Average length of queue
  4. Expected utilisation of the server at any given point

To Decide

  1. Is it worthwhile to improve on service times
  2. ‘Auto Scale!’
  3. Should we introduce priorities
  4. Is waiting area adequate

Little's Law

L = ƛW

ƛ = Arrival Rate
W = Waiting times
L = Total being serviced

Presentation

SRE Platform

Top comments (0)