Field · 4 models

Queueing and Discrete-Event Simulations

Queues form whenever work arrives faster than it can be served — briefly, by chance, even when capacity looks sufficient on average. These models build waiting lines one event at a time and compare what happens with what queueing theory predicts.

Models in this field

  • OS-018M/M/1 queueOne server, random arrivals, random service: why waits explode as utilization ρ = λ/μ approaches 1.
  • OS-019M/M/c queueSeveral servers, one shared line: Erlang C waiting probability and the pooling effect.
  • OS-020Little's lawAverage number in system = arrival rate × average time in system, read off one picture.
  • OS-021Discrete-event simulationClock, future event list, event routines: the method behind queue simulators, one event at a time.

Discrete-event simulation

Nothing changes in a queue between events, so the simulation does not tick a clock forward in fixed steps. It keeps a list of future events — the next arrival, the next service completion — jumps the clock to the earliest one, updates the state and schedules whatever that event causes. Discrete-event simulation shows that machinery step by step; SimPy examples write the same models with Python’s best-known DES library.

The models

  • M/M/1 queue: one server, random arrivals and service times. The reference model of queueing theory, with exact formulas for every average.
  • M/M/c queue: several servers sharing one line, and why pooling servers cuts waiting times so sharply.
  • Little’s law: L = λW, the one queueing result that holds for almost any stable system.
  • Discrete-event simulation: two stations in series, checked against Jackson’s network theorem.

Utilization is the whole story near capacity

In an M/M/1 queue the mean number of customers in the system is ρ/(1 − ρ), where ρ is the fraction of time the server is busy. At ρ = 0.5 that is 1; at 0.9 it is 9; at 0.99 it is 99. Waiting grows without bound as utilization approaches 1, and at or above 1 there is no steady state at all — the models report the queue as unstable rather than printing a meaningless average. Simulated averages also converge slowly near capacity, because the queue length changes slowly and consecutive observations are strongly correlated.