Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 38 · Getting Started

The Anatomy of a Queue

Learn the parts of a queueing system: arrival process, service times, number of servers, buffer size, population and service discipline.

To describe any queue precisely, you must answer a few questions. Who arrives, and how often? How long does service take? How many servers are there? How many customers can wait? In what order are they served? Once you pin these down, the system becomes a math model you can analyze or simulate.

This lesson walks through each ingredient. By the end you will be able to describe a real situation, such as a bank branch or a web server, as a queueing model.

The six ingredients

Ingredient Question it answers Typical choices
Arrival process How do customers arrive? Poisson, scheduled, batches
Service times How long does one customer take? Exponential, constant, general
Servers How many can work at once? 1, c, or unlimited
Capacity How many customers fit in the system? Unlimited or K
Population How many potential customers exist? Infinite or finite N
Discipline Who is served next? FIFO, LIFO, random, priority

Arrival process

We describe arrivals by the interarrival times, the gaps between consecutive arrivals. Their average gap is 1/λ, so λ (lambda) is the arrival rate, in customers per unit time. If the average gap is 2 minutes, then λ = 0.5 per minute.

Service times

Each customer needs a random amount of work. The mean service time is 1/μ, so μ (mu) is the service rate of one busy server. A server with mean service time 4 minutes has μ = 0.25 per minute.

Servers

With c servers, up to c customers are served at the same time. A bank with 3 open tellers has c = 3. Some systems, such as self-service, behave as if c were unlimited.

Capacity and population

A waiting room can be limited: a phone line with room for 10 callers rejects the 11th. The pool of customers can also be limited: a factory with 5 machines that break down has only 5 possible "customers" for the repair crew. These are covered in later chapters. Until then we assume unlimited room and an unlimited population.

Service discipline

FIFO (first in, first out) serves in arrival order, as in a polite line. LIFO serves the newest first, like a stack of papers. Random picks anyone. Priority lets important customers jump ahead.

The discipline changes who waits, but often not the average wait, as the next TryIt shows.

Does the order matter?

A simple rule holds for many systems: if the discipline does not look at the service time and the server never idles when work is waiting, then the average number in the system is the same. The spread of waits is not. Let us test that with an event simulation of one server using three disciplines.

Python FIFO, LIFO and random order

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

You should see similar means but a larger spread for LIFO and random. LIFO leaves some unlucky customers waiting a very long time.

Describing a real system

Take a pharmacy counter: customers arrive about 20 per hour, one pharmacist serves each in 2.4 minutes on average, nobody leaves, the line is as long as it needs to be, and service is in order. That is one server, λ = 20/h, μ = 25/h, unlimited capacity, infinite population, FIFO. The pharmacist is busy λ/μ = 80% of the time.

Python Describe a system

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Always write units next to every rate. Mixing "per minute" and "per hour" is the most common mistake in queueing problems.

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. Customers arrive on average every 4 minutes. What is the arrival rate in customers per hour?

    Average gap 4 minutes means 60/4 = 15 arrivals per hour.
  2. 2. Which discipline serves the most recent arrival first?

    LIFO means last in, first out.
  3. 3. Three tellers each serve 12 customers per hour, and 24 customers arrive per hour. What is the utilization of each teller?

    Utilization is lambda / (c * mu) = 24 / (3 * 12) = 2/3.

Summary

  • A queueing model needs an arrival process, service times, servers, capacity, population and a discipline.
  • λ is the arrival rate and μ the service rate per server; means are 1/λ and 1/μ.
  • Utilization is ρ = λ / (cμ).
  • Order of service changes the spread of waits more than the average.

Next: Kendall Notation