# Adding a new teller | queuing theory example

queuing theory is an important area of knowledge to understand how systems behave at scale.

Created:

We assume customer arrivals and customer service times are random (details later). With only one teller, customers will have to wait nearly five hours on average before they are served. But if you add a second teller, the average waiting time is not just cut in half; it goes down to about 3 minutes. The waiting time is reduced by a factor of 93x.

I remember studying a bit of queuing theory in college and completely forgotten all about it. This post is a good reminder of this very practical set of tools. This is also very useful in understanding server behaviours.

Someone in the comment mentioned PDQ: (Pretty Damn Quick) Performance Analyzer:

From a performance standpoint, a modern computer system can be thought of as a directed graph of individual buffers where requests may wait for service at some computational resource, e.g., a CPU processor. Since a buffer is just a queue, all computer systems can be represented as a directed graph of queues. The directed arcs represent flows between different queueing resources. PDQ computes the performance metrics of such a graph. A directed graph of queues is generally referred to as a queueing network model.