DEV Community

Nishant Modak
Nishant Modak

Posted on

2

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

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

Try REST API Generation for Snowflake

DevOps for Private APIs. Automate the building, securing, and documenting of internal/private REST APIs with built-in enterprise security on bare-metal, VMs, or containers.

  • Auto-generated live APIs mapped from Snowflake database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay