Twinworks Queueing Check
M/M/1, M/M/c, M/D/1, M/G/1 and Kingman waiting times — optionally verified by simulation.
How it works
Closed-form queueing results for a single workstation: utilization, mean waiting time, queue length and time in system for M/M/1, M/M/c (Erlang C), M/D/1, M/G/1 (Pollaczek–Khinchine) and the Kingman G/G/1 approximation. Optionally runs the Twinworks simulation of the same station and reports whether the theory lies inside the simulated confidence interval.
- M/M/1: Wq = ρ/(μ−λ). M/M/c: Wq = C(c, a)/(cμ−λ) with the Erlang C probability C computed by a stable recursion. M/G/1: Wq = λE[S²]/(2(1−ρ)) (Pollaczek–Khinchine), M/D/1 is the special case SCV = 0. Kingman: Wq ≈ ((ca²+cs²)/2)·(ρ/(1−ρ))·te.
- L = λW and Lq = λWq (Little’s law).
- Verification builds a source → unlimited queue → station → sink model, simulates long replications (≈ 20 000 arrivals each, 5 % warm-up) and checks whether the theoretical Wq lies inside the Student-t interval of the simulated mean wait.
Formulas assume steady state, infinite queue capacity and FIFO service. Kingman is an approximation.
Sources
- Gross, Shortle, Thompson & Harris: Fundamentals of Queueing Theory, 4th ed. (Wiley, 2008) (Wiley)
- Kingman, J. F. C.: The single server queue in heavy traffic (Proc. Cambridge Phil. Soc. 57, 1961)
- Hopp & Spearman: Factory Physics — VUT equation (Waveland Press)
Part of Twinworks
-
Twinworks Factory digital twin & production simulation
Model a production line, simulate it and find the bottleneck — free.
Related tools
- Twinworks Factory Simulation – Simulate a production line: throughput, lead time, WIP, OEE and the bottleneck, with CIs.
How to use the Twinworks Queueing Check
Calculate utilization, waiting time and queue length for one workstation with M/M/1, M/M/c, M/D/1, M/G/1 or Kingman, and check the theory by simulation.
What it is for
Parts arrive at a machine, test bench or packing desk unevenly, and the work doesn't always take the same time, so a queue forms even when the station has spare capacity on paper. This tool tells you how long that queue gets and how long a part waits, using the standard closed-form formulas for a single workstation.
Pick a model, enter the arrival rate in parts per hour and the mean service (cycle) time in seconds, and you get utilization, mean waiting time in the queue (Wq), time in system (W), mean queue length (Lq) and parts in the system (L). For M/M/1, M/M/c and M/D/1 you can also tick Verify by simulation: the same station is built in the Twinworks simulator and run for several long replications to see whether theory and simulation agree.
It covers one station in steady state with an unlimited queue and first-come-first-served order. For a whole line with buffers, breakdowns and shifts, use the Twinworks Factory Simulation.
Worked example
The built-in example is an M/M/1 station: 60 arrivals per hour and a mean service time of 48 s, verified with 10 replications.
M/M/1: utilization 80%, mean wait 192 s, mean queue 3.2; simulation confirms the result.
The full numbers: Wq = 192 s, W = 240 s, Lq = 3.2, L = 4, and 80 % of parts have to wait at all. The simulation gave a mean wait of 193.4 s with a 95 % interval of 177.2–209.6 s and a utilization of 80.1 %. The theoretical 192 s lies inside the interval, so the check passed.
Now change only the variability. The same 60/h and 48 s as M/D/1 (constant service time) gives a mean wait of 96 s and a queue of 1.6, exactly half. Same load, half the waiting, just because the cycle time no longer varies. Push the arrivals to 80/h and M/M/1 reports unstable (ρ = 1.067 ≥ 1): the station needs 64 minutes of work per hour, and the queue grows without limit.
How to read the result
- ρ (utilization): arrival rate × service time ÷ number of servers. It must be below 1, or there is no steady state.
- Wq / W: mean wait before service, and wait plus service. Both in seconds.
- Lq / L: mean number waiting, and waiting plus in service. They follow from Little's law (L = λW).
- P(wait): the share of arrivals that find the station busy. For M/M/c this is the Erlang C probability.
- Exact: false for Kingman, which is an approximation.
- Verification: simulated mean wait and utilization with confidence intervals, and whether the formula lies inside.
Tips and common mistakes
- Waiting time explodes near 100 %. At ρ = 0.8 the M/M/1 wait is 4 × the service time; at 0.9 it's 9 ×; at 0.95 it's 19 ×.
- SCV means variance ÷ mean². Exponential times have SCV 1, constant times 0. Measure it from real cycle times instead of guessing.
- Kingman (G/G/1) splits the blame: (arrival SCV + service SCV) ÷ 2 × ρ/(1−ρ) × service time. The example with SCVs 0.25 and 1.5 at 83.3 % gave 262.5 s, so smoothing the process helps more than smoothing arrivals.
- Verification only runs for M/M/1, M/M/c and M/D/1. For M/G/1 and G/G/1 the tool shows a warning instead.
- Two servers sharing one queue (M/M/2) wait much less than two separate M/M/1 stations at the same load: 136 s in the M/M/2 example at 83.3 %.
FAQ
Which model should I choose?
M/M/1 if arrivals are random and service times vary a lot, M/D/1 for a fixed machine cycle, M/M/c for several identical servers sharing one queue, and Kingman when you know both SCVs.
Why does the simulation not match the formula exactly?
Each replication is a random sample. The check passes when the formula lies inside the confidence interval of the simulated mean, which is what you expect from a correct model.
What if the result says unstable?
Utilization is 1 or more, so the queue grows forever. Add a server, shorten the cycle or reduce arrivals.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://twinworksqueueformulas.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://twinworksqueueformulas.usefulweb.site/mcp· tool nametwinworks_queue_formulas
Example request
curl -s -X POST https://twinworksqueueformulas.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"queue":"mm1","arrivalsPerHour":60,"serviceTime":48,"verify":true,"replications":10}'