# Queuing Theory

> A conceptual representation of a system as queues with arrival and service rates, used to predict waiting time and size capacity.

Record: `architecture:queuing-theory`
Kind: model
Layer: [Performance Core](https://banes-lab.com/records/layer/performance-core.md)
Severity: contextual
Scope: performance, capacity, system
Canonical: https://banes-lab.com/ontology#architecture-queuing-theory

Listed in [Architecture principles](https://banes-lab.com/api/records/architecture.md), after [Read Replica](https://banes-lab.com/records/architecture/read-replica.md) and before [Streaming Architecture](https://banes-lab.com/records/architecture/streaming-architecture.md).

## Repair

- Refactored by: Size the system from an M/M/1 (or M/M/c) queuing model
- Detected by: latency collapsing as utilization approaches saturation
- Violated by: worker pool sized by guesswork with no arrival/service-rate model
- Measured by: predicted vs actual queue depth and wait time
- Enforced by: capacity review

## Requires

- [Arrival and Service Rates](https://banes-lab.com/records/lexicon/arrival-and-service-rates.md)

## Reinforces

- [Capacity Planning](https://banes-lab.com/records/lexicon/capacity-planning.md)
- [Latency](https://banes-lab.com/records/architecture/latency.md)

## Enables

- [Wait-Time Prediction](https://banes-lab.com/records/lexicon/wait-time-prediction.md)
- [Utilization-Based Sizing](https://banes-lab.com/records/lexicon/utilization-based-sizing.md)

## Conflicts with

- [Guess-Based Capacity](https://banes-lab.com/records/lexicon/guess-based-capacity.md)

## In tension with

- [Model Assumptions](https://banes-lab.com/records/lexicon/model-assumptions.md)

## Tensions

- [Queuing Theory / Model Assumptions](https://banes-lab.com/records/tension/model-assumptions-queuing-theory.md)

## Contracts

- [Queuing Theory](https://banes-lab.com/records/algorithms/queuing-theory.md)

## Severity

- [contextual](https://banes-lab.com/records/vocabulary/severity-contextual.md)

## Category

- [Scalability / Performance / Optimization](https://banes-lab.com/records/architecture-category/scalability-performance-optimization.md)

## Linked from

- [Scalability / Performance / Optimization](https://banes-lab.com/ontology/principles/architecture-category-scalability-performance-optimization.md)
- [Core Vocabulary](https://banes-lab.com/ontology/lexicon/lexicon-category-core-vocabulary.md)
- [Scalability / Performance / Optimization](https://banes-lab.com/ontology/lexicon/lexicon-category-scalability-performance-optimization.md)
- [Architecture](https://banes-lab.com/ontology/algorithms/algorithms-domain-architecture.md)
- [Severity levels](https://banes-lab.com/ontology/schema/the-vocabulary-severity.md)
- [The resolutions](https://banes-lab.com/ontology/schema/the-resolutions.md)
