Server
The component that does the work. Input and output.
How it works#
The Server pulls an entity from its source, holds it for a service time, then pushes it downstream. It stands for a request handler, a worker thread, a database, a cashier — anything that can only be busy with one thing at a time.
That last point matters when you size a system: one server serves one entity at a time. To model a pool of N parallel workers, place N servers behind the same queue — each pulls independently, so the queue is drained by whichever server frees up first. For a system that serves all its callers at once and slows under load, use a Shared Server instead.
Unless you choose another Distribution, service times are exponentially distributed around the rate you set, so individual jobs vary widely even though the average is fixed. Compare that rate with the arrival rate feeding it to get the utilisation of the system: as the two approach each other, queue lengths and waiting times climb sharply — long before utilisation reaches 100%.
A server must have an incoming connection. Its outgoing side is optional: with nothing connected, entities it finishes count as completed and leave the model, which makes the last server in a chain a natural exit point. With several queues feeding it, it alternates round-robin between them. It has one output; a Router after it divides what it finishes.
Settings#
- Service Rateentities per second — default 3
- The mean rate μ at which the server completes work. The mean service time is 1/μ, whichever distribution is chosen.
- Distributiondefault Exponential
- How service times are spread around their mean: Exponential, Deterministic, Uniform, Erlang or Lognormal. Under Exponential most jobs are short and a few take much longer — the behaviour real request handlers usually show.
- Spreadshare of the mean, 0 to 1 — default 0.5
- Shown when the distribution is Uniform. How far either side of the mean a service time can fall.
- Stagesexponential stages, 1 to 100 — default 2
- Shown when the distribution is Erlang. More stages, less variation.
- Variabilitystandard deviation over the mean, 0.1 to 10 — default 1
- Shown when the distribution is Lognormal. The coefficient of variation of the service times.
- Wait Timeoutseconds, 0 to 3600 — default 1
- How long a finished entity waits outside a full queue for room before it is dropped. The server is blocked for that time. 0 means no waiting: the entity is dropped at once, and the server moves on to its next job.
The service rate can be changed while the simulation runs — the fastest way to see how much headroom a stage actually needs. So can Spread, Stages and Variability; the distribution itself is fixed for the length of a run. Distributions describes each one and what its shape setting does. Wait Timeout is set in the editor, before a run, and applies when the queue's Overflow Policy is NO_OVERRIDE; Full queues and waiting covers it in full.
Server states#
A server is always in one of three states, and which one it spends its time in tells you what to fix.
- Waiting
- Idle — asking its source for an entity and getting nothing back.
- Busy
- Serving an entity for the duration of its service time.
- Blocked
- Finished serving, with the entity waiting outside a full queue. The server serves nothing else until that entity is admitted or dropped.
Mostly waiting means the server is starved and the bottleneck is upstream. Mostly busy means it is the bottleneck. Time spent blocked, or a dropped rate that is climbing, means the bottleneck is downstream: the queue after it is full, and adding capacity here would change nothing.
Statistics#
- Server state probability — the share of time spent waiting, busy and blocked. This single chart is usually enough to locate the bottleneck in a chain of servers.
- Entity rate — completed and dropped entities per second over time. Entities are dropped here when the server finishes work the queue after it finds no room for within the Wait Timeout.
- After a batch run, the share of time busy and waiting, and the completed and dropped rates, each as a mean per run with a confidence interval.