What is queueing?
The study of waiting lines: how arrivals, service speed and the number of servers determine how long people or items wait.
Queueing diagram example
Queueing is the study of waiting lines and the systems that form them: customers at a counter, patients in a waiting room, requests at a server. It explains why waits happen even when capacity looks sufficient on average, and it helps decide how many servers or beds are needed for an acceptable wait.
How it works
A queue forms whenever arrivals and service are uneven. Even if the average service rate exceeds the average arrival rate, random bunching of arrivals creates waits. The main drivers are the arrival rate, the service rate, the number of servers and the variability of both. As utilization, arrivals divided by service capacity, approaches 100%, waiting time grows very steeply, and above 100% the queue grows without limit.
Adding servers helps more than the numbers suggest, because one shared line served by several servers copes with variation better than separate lines. Little's law connects the pieces: the average number waiting equals the arrival rate times the average wait.
Example
Say a hospital pharmacy receives 18 prescriptions an hour and each pharmacist fills 10 an hour. With one pharmacist, utilization is above 100% and the queue grows forever. With two, capacity is 20 an hour and utilization is 90%, which is stable but leads to waits. With three, capacity is 30 and utilization is 60%, and waits shrink greatly. The step from two to three pharmacists gives far more improvement than from one to two. The numbers are an illustration.
How to model it in Machinations
Use a Source for arrivals and a Queue that releases one item at a time into a Converter or Drain representing the server. Give it a rate, and repeat the server to represent more staff. Add a Register for average wait. Make the arrival rate and number of servers Levers. Play many times at once and chart the Queue length to see the spread of waits.
See queueing in a system you can Play
Build the rules in a Machinations diagram, change a value and Play it to watch how the system responds.