Components

A model is a diagram of components joined by connections. Nine components are available today, and between them they cover the classic queueing systems.

Entities#

Everything that moves through a model is an entity: one request, one order, one packet, one customer. Entities are created by a generator, wait in queues, are served by servers, and eventually leave the model — either completed, having reached a component with nothing after it, or dropped, if a full queue turned them away along the way.

Each entity carries the moment it was created, which is what lets the simulator report how long entities took to travel through the system end to end.

The building blocks#

GeneratorOutput onlyCreates entities at a configurable rate, constant or following a traffic profile, and pushes them into the model. Use it for arriving requests, customers, orders or messages — any work your system does not control.QueueInput and outputHolds entities that have arrived but cannot be served yet. Use it for a thread pool's work queue, a broker backlog or a line of customers.ServerInput and outputTakes one entity at a time, holds it for a service time and passes it on. Use it for a request handler, a worker thread, a database or a cashier.DelayInput and outputHolds every entity for a time — the same for all by default — with no limit on how many at once. Use it for a network hop, a conveyor or a lead time.RouterInput and outputPasses each entity to one of several branches, in turn, at random or by weight. Use it for a load balancer, a dispatcher or a traffic split.Shared ServerInput and outputServes every entity it holds at once, each more slowly the more it holds. Use it for a database, a downstream API or any system that slows under load.Resource PoolNo connectionsA limited number of identical units that entities take, hold across several steps and return. Use it for a connection pool, a thread pool or a set of licences.AcquireInput and outputTakes one unit of a resource pool for each entity, and holds the entity back while none is free. Use it where a request checks out a connection or claims a thread.ReleaseInput and outputReturns one unit to a resource pool as the entity passes. Use it where the resource is free before the entity has finished.

Each component has its own settings, its own behaviour when the component next to it is not ready, and its own set of live charts. The pages above cover all nine.

Anatomy of a model#

The natural chain is Generator → Queue → Server. The generator sets the pace at which work arrives, the server sets the pace at which it is done, and the queue absorbs the difference between the two. That single chain is the classic single server queueing system, and it is enough to reproduce most of the behaviour people find surprising about real systems — for instance that waiting time climbs steeply long before a resource is fully busy.

Larger models are repetitions of the same shape. Put several servers behind one queue to model a pool of parallel workers. Chain a second queue and server after the first to model a downstream service, and put a delay between the stages for the time it takes to get there. Put a router after a generator to split traffic between several queues. Put a shared server after a pool of servers for the database they all call. Put an Acquire and a Release either side of the steps that need a connection, and a resource pool beside them for the connections there are.

How components hand entities to each other — who pushes, who pulls, what happens when the other side is not ready, and what several connections on one side mean — is covered in Connections.