← Back to list
Computing & Embedded
#대기행렬#성능모델링#리틀의법칙#용량산정#M/M/1
Last updated · 2026-10-30

Queueing Theory and IT System Performance Modeling

1. Overview

A. Definition

Queueing theory describes the arrival process of customers (requests, transactions, packets) demanding service and the service process of servers as probabilistic models, mathematically predicting performance metrics such as queue length, waiting time, and server utilization. It was created in 1909 by the Danish mathematician A. K. Erlang to size the number of circuits in telephone exchanges, and today it forms the theoretical foundation for response-time analysis and capacity planning of IT systems.

The fundamental cause of queues is 'irregularity of arrivals and finiteness of service'. If requests arrived at perfectly regular intervals and the server processed them faster, no waiting would occur. But real requests repeatedly cluster and thin out (burstiness), and a server can process only a finite number at once, so when requests momentarily exceed processing capacity, a queue builds up. The important point is that this waiting appears far before the server is saturated. Even at an average utilization of just 50%, waiting already exists because of variability, and as utilization rises, waiting surges not linearly but nonlinearly (exponentially). Queueing theory is precisely the tool that quantifies this 'delay created by variability'.

B. Background and Why It Is Needed in IT

The performance requirements of IT systems (response time, throughput, concurrent users) usually become problematic not at the 'average' but in the 'tail'. Even if the average response time is 50ms, if the top 1% (p99) exceeds 2 seconds, the user experience collapses. Much of this tail latency arises not from CPU computation itself but from the waiting time to obtain resources, so performance cannot be explained by merely watching "what percent is the server CPU". Queueing theory reduces every point where 'many contend for a finite service resource'—CPU, disk I/O, thread pools, connection pools, network links—to a single common mathematical model, making it predictable how much resource must be added to meet a target latency.

In practice, the questions this theory answers are concrete. Design and operational decisions such as "if traffic doubles, by how many times does response time grow", "how many web server instances must be added to keep the target p95 response time", and "what connection pool size keeps threads from starving" all converge onto queueing models. If measurement (APM, load testing) shows 'what is happening now', queueing theory is complementary in that it lets you extrapolate 'what will happen under a load not yet experienced'.

C. The Three Axes of Performance — Throughput, Latency, Utilization

Queueing theory lets us understand performance as the relationship among three axes: throughput, response time (latency), and utilization. A common misconception is the idea that these three can be improved independently, but in reality they are tightly intertwined. Raising utilization (using resources frugally) worsens response time; keeping response time requires yielding utilization; and the throughput limit is ultimately set by the service rate μ and the number of servers c. Performance design is the work of finding the balance point among these three axes that suits business needs.

This perspective is especially useful when diagnosing performance problems. When response time is poor, you must distinguish whether the cause is 'the service itself being slow (μ dropping)' or 'the waiting being long (ρ excessive)' in order to arrive at the correct remedy. The former must be approached with code/query optimization, the latter with resource expansion/load balancing, and confusing the two leads to investing in the wrong place. Queueing metrics (ρ, Wq, queue length) are the very diagnostic tools that separate out and reveal these two causes.

2. Structure and Notation of Queueing Systems

A queueing system is abstracted as a flow of arrival → queue → server → departure, as shown below. The power of this model is that any IT resource (a thread pool processing web requests, a disk I/O queue, a message broker consumer, etc.) can be mapped onto this common framework.

flowchart LR
  SRC["Arrival(arrival rate λ)"] --> Q["Queue"]
  Q --> SV["Server(service rate μ, c servers)"]
  SV --> OUT["Depart after completion"]
  Q -.->|"reject/drop when queue is full"| DROP["Drop(blocking)"]
  style Q fill:#fff3cd,stroke:#d39e00,stroke-width:2px
  style SV fill:#e8f0fe,stroke:#2f6fed,stroke-width:2px

A. Components

There are four elements that characterize a queue. First, the Arrival Process is the distribution of inter-arrival times of requests; IT traffic is often approximated by a Poisson process (exponential inter-arrival times) in which arrivals are mutually independent and random. This is because it well describes a situation where numerous independent users each send requests. Second, the Service Process is the distribution of the time a server takes to process one request; for analytical convenience an exponential distribution is often assumed, but actual processing time may vary more or less than that.

Third, the number of servers (c) is the number of windows that can process requests simultaneously, corresponding to the number of web server instances, thread pool size, or number of DB connections. Fourth, the Queue Discipline is the order in which waiting requests are processed; it is mostly FIFO (first-in-first-out), but there are also priority queues, LIFO, and processing-time-based (SJF), and this choice greatly changes the tail-latency distribution. Adding the waiting-room capacity (K) and the customer population size (N) fully specifies the system. If capacity is finite (finite K), requests are rejected when the queue is full—this is precisely the mathematical archetype of the 503/timeout that a load balancer or server returns under overload.

The 'abstraction' itself—mapping these components onto IT resources—is the practical value of the queueing model. For example, Tomcat's thread pool reduces to an M/M/c/K with c servers and a finite queue (acceptCount), and a database connection pool reduces to a model that treats c connections as servers. Because bottlenecks at different layers can be described in the same language, you can consistently trace at which stage a request waits and identify the point that saturates first (the bottleneck).

B. The Impact of Queue Discipline on Performance

Even with the same resource and the same load, performance characteristics change greatly depending on in what order waiting requests are processed (queue discipline). The most common FIFO is fair, but if one request with a long processing time blocks the front, all the short requests behind it are delayed—head-of-line blocking occurs. Conversely, SJF (Shortest Job First), which processes short jobs first, minimizes average waiting time but can cause starvation as long jobs keep getting pushed back. The network's WFQ, the OS scheduler's priority queue, and a message broker's priority topics are all devices that handle this trade-off.

In practice, queue discipline is used as a means to 'protect SLA-critical requests'. For example, placing core transactions such as payments at the top of a priority queue can suppress the tail latency of core requests even when overall load is high. However, introducing priorities causes the waiting of low-priority requests to surge, so a design that guarantees minimum throughput with quotas or weights to prevent starvation must go in parallel. Thus the choice of queue discipline is a balance problem among 'average', 'fairness', and 'tail latency', and queueing theory lets us quantitatively compare the effect each discipline has on these three axes.

C. Kendall's Notation

Queueing systems are concisely classified by Kendall's notation in the form A/S/c/K/N/D. For example, M/M/1 means 'Markov (exponential) arrivals / Markov service / single server', and M/M/c means multiple servers. Thanks to this notation, IT resources that look entirely different can be bundled and reused under the same mathematical model.

Symbol Meaning IT system example
A Arrival distribution (M=exponential, D=deterministic, G=general) User request pattern
S Service distribution (M/D/G) Per-request processing-time distribution
c Number of servers (windows) Threads, instances, connections
K Maximum system capacity Queue buffer size, backlog limit
N Customer population size Total number of clients
D Queue discipline FIFO/priority/SJF

3. Core Laws and Performance Metrics

A. Little's Law

The most widely used universal law in queueing theory is Little's Law, expressed as L = λ × W. That is, the average number of requests in the system (L) equals the product of the arrival rate (λ) and the sojourn time (W). The power of this law lies in its universality: it always holds in a 'steady state' without any assumption about the arrival or service distributions. Even without knowing the distribution, if you measure two of the three values, you can immediately obtain the remaining one.

As a practical application, at an API gateway processing 500 requests per second (λ=500) with an average sojourn time of 40ms (W=0.04s), Little's Law tells us there are on average L = 500 × 0.04 = 20 requests simultaneously 'being processed or waiting' inside the system. This becomes a capacity-design basis that the connection pool or thread pool must be set to at least 20 so requests do not starve for lack of resources. Conversely, by measuring throughput while the thread pool size is fixed, you can also back-calculate the average latency.

B. The Formulas of the M/M/1 Model and State Transitions

The most basic M/M/1 model (single server, Poisson arrivals, exponential service) is modeled as a Birth-Death Process. The number of requests in the system is the state; when a request arrives the state increases at rate λ (birth), and when processing finishes it decreases at rate μ (death). Below depicts this state transition, where the key point is that the transition rate between each state is constant at λ (forward) and μ (backward).

flowchart LR
  S0(("0")) -->|"λ"| S1(("1"))
  S1 -->|"μ"| S0
  S1 -->|"λ"| S2(("2"))
  S2 -->|"μ"| S1
  S2 -->|"λ"| S3(("3+"))
  S3 -->|"μ"| S2
  style S0 fill:#f1f8e9,stroke:#558b2f
  style S3 fill:#fde0e0,stroke:#c0392b

Solving this balance equation derives the core metrics. The server utilization is ρ = λ/μ, the average number of requests in the system is L = ρ/(1−ρ), the average sojourn time is W = 1/(μ−λ), and the average waiting time in the queue is Wq = ρ/(μ−λ). Concretely, if a server can process 100 requests per second (μ=100) and 80 arrive per second (λ=80), then since ρ=0.8, L = 0.8/0.2 = 4 requests, W = 1/(100−80) = 0.05s = 50ms, and counting only the queue wait, Wq = 0.8/20 = 0.04s = 40ms. That is, actual processing needs only 10ms, yet because of waiting the perceived latency grows to 50ms.

What deserves attention here is that the sojourn time W decomposes into the sum of 'pure service time (1/μ)' and 'waiting time Wq' (W = 1/μ + Wq). In the example above, no matter how much you optimize the code, the 10ms service time cannot touch the 40ms wait, and the wait shrinks only by lowering ρ (expansion, load balancing). This decomposition answers the common question "why does it slow down only at peak with the same code"—what slowed down is not the service but the wait, because the wait grows nonlinearly as traffic approaches the service rate. This very distinction, which separates the direction of performance tuning (code optimization vs. resource expansion), is the most practical insight the queueing model offers.

C. Utilization and Saturation — Nonlinear Surge

The most important intuition queueing theory offers is that the closer utilization gets to 100%, the more latency explodes exponentially. In the M/M/1 formula above, L = ρ/(1−ρ) diverges as ρ approaches 1 and the denominator converges to 0. In the earlier example, raising the arrival rate to 90 (ρ=0.9) gives L = 0.9/0.1 = 9 requests and W = 1/10 = 100ms, doubling the latency, and at ρ=0.95, W ≈ 200ms, doubling again. This nonlinearity, where latency doubles though traffic rose by only 12.5% (80→90), is the mathematical identity of the 'performance cliff' where a system that was fine in normal times suddenly collapses at peak hour.

For this reason, performance engineering takes as a rule of thumb keeping average utilization bound at a level of 70–80%. The remaining 20–30% is not 'waste' but a 'buffer' that absorbs variability and suppresses tail latency. This runs directly counter to the intuition that packing resources full is cost-efficient, and it is a design principle hard to argue for without queueing theory.

D. The Stability Condition and Implications of the Poisson Assumption

For a queueing model to yield meaningful finite metrics, the stability condition (ρ < 1) must hold—that is, the long-run average arrival rate must be smaller than the service capacity. If ρ ≥ 1, the queue piles up infinitely and the sojourn time diverges as time goes on; this is precisely the identity of the phenomenon where, in an overloaded system, response time 'does not converge to a fixed value but keeps growing'. If, in operation, requests only keep piling up and do not decrease, it means not a problem solvable by tuning but a structural saturation state where the processing capacity itself is insufficient. Therefore, monitoring must watch not only momentary latency but also the trend of queue length, taking an unbroken upward trend as an early-warning signal.

The Poisson arrival assumption comes with a useful property called PASTA (Poisson Arrivals See Time Averages). It says that the average state (queue length, etc.) observed at the moment a Poisson-arriving request enters the system equals the time average, allowing 'the wait a randomly arriving request experiences on average' to be interpreted directly as the system's long-run average. However, since this property holds only when arrivals are Poisson, in cases where requests enter in bundles like batch jobs (batch arrivals) or where arrivals take on autocorrelation due to a retry storm, the theoretical value may underestimate reality. A retry storm is especially dangerous: when clients pour re-requests at a slowed server after timeouts, the arrival rate shoots up nonlinearly and accelerates saturation, so making the arrival process itself gentle with exponential backoff and circuit breakers is the key defense from a queueing standpoint.

4. Model Comparison and Application Cases

Since real IT resources do not have only a single server, you must choose a model that fits the situation. As the comparison below shows, entirely different operational characteristics appear depending on how you set the number of servers and the capacity constraint, and that difference is split by 'the effect of parallel processing' and 'behavior under overload'.

Model Characteristics Representative IT application Core implication
M/M/1 Single server, infinite queue Single-thread worker, serial I/O Latency diverges at saturation
M/M/c Multiple servers, infinite queue Web server pool, thread pool Waiting plummets with added servers (Erlang C)
M/M/c/K Multiple servers, finite queue Backlog-limited server, load balancer Requests rejected when queue is full (503)
M/G/1 General service distribution Jobs with large processing-time variance (batch) Service variability grows the wait

A. Server Consolidation Effect and Service Variability

What deserves particular attention is the 'server consolidation effect' of M/M/c. When processing 160 requests per second (λ=160) with one server processing 100, two servers sharing a common queue (M/M/2) show a much shorter waiting time than two independent servers each receiving 80. In the independent configuration, when requests cluster at one server while the other is idle, the other can sit idle; but a common queue immediately assigns requests to the free server. This is why placing servers behind a load balancer and operating them like a common queue is more advantageous than fixedly assigning a server per user. The more servers there are, the greater this consolidation effect grows, so for the same ρ a large pool has smaller tail latency than a small pool. This is the fundamental reason why, in a multi-tenant environment, a design that splits and fixedly assigns resources per tenant is less efficient than one that operates the whole resource as a shared pool, and limiting only the parts that truly need isolation with quotas is the model design from a queueing standpoint. The M/G/1 model, through the Pollaczek–Khinchine formula—that the variance of service time directly affects the wait—explains why jobs with large processing-time variance (e.g., file uploads of wildly varying size) induce a longer wait even when the average processing time is the same.

B. Industry Application Cases

The original case of queueing theory is telecommunication networks. A telephone exchange operates with far fewer circuits than subscribers, and here 'how many circuits are needed to keep the call-loss probability below 1%' is sized by the Erlang B formula. The same principle is used as is today for VoIP trunk capacity and for the concurrent-call capacity design of mobile base stations. The trunking efficiency that stably accommodates tens of thousands of subscribers with a small number of resources rests precisely on the queueing model.

In the web/cloud domain, connection pool tuning is a representative example. If an application server sets the DB connection pool excessively large, lock contention and context switching increase on the DB side and throughput actually drops—this is explained by the backfire that appears when c is blindly increased in M/M/c and by the contention term of the USL. The reason many performance guides recommend "keep the connection pool small, on the order of a few times the number of CPU cores" is the result of the queueing insight that, since the service resource (DB) is finite, absorbing the wait into the application queue is better than slowing the whole system down through internal DB contention.

5. Advanced: Practical Application in Performance Engineering and Extended Models

A. Application to Capacity Planning

Queueing models are used directly to size the number of servers for a new service or to predict the timing of expansion in anticipation of expected traffic growth. For example, when the target p95 response time is 200ms and the per-request service time averages 50ms, the M/M/c formula (Erlang C) back-calculates the minimum number of servers c that satisfies the target latency. The Erlang C formula once used to size the number of call-center agents is reused as is for the number of microservice instances and for sizing the connection pool. The cloud's auto-scaling policy (target CPU utilization 70%, etc.) can also be interpreted as essentially automating the queueing principle of 'binding ρ within a safe zone'.

Consider a concrete expansion-decision case. Suppose a payment API processes 50 requests per second per server (μ=50) and the current peak traffic is 160 per second (λ=160). With 4 servers, against a total capacity of 200 requests, ρ=160/200=0.8, which is a safe zone; but if a marketing event causes traffic to jump 1.5× (λ=240), then with 4 servers ρ=240/200=1.2, which violates the stability condition, so the queue piles up infinitely and payments time out one after another. To keep the target ρ at 0.8, the required capacity is 240/0.8=300 requests, i.e., the conclusion that 6 servers are needed comes out immediately. Thus queueing theory gives a preemptive answer, hard to obtain by measurement alone, to the practical question "how many must I spin up before the event". In fact, pre-scale-out ahead of a large commerce flash sale or expansion ahead of holiday traffic all presuppose this calculation.

B. The Universal Scalability Law (USL) and Modern Extensions

The simple M/M/c model assumes that adding servers increases throughput linearly, but in reality it does not, because of contention and coherency cost (consistency maintenance). Neil Gunther's Universal Scalability Law (USL) adds two decay terms here to explain the phenomenon where, as servers/threads are added, throughput growth slows and, past some point, actually decreases (negative scaling). The experience that blindly adding connections to a DB with heavy lock contention actually slows it down is quantified by the USL. This corrects the naive assumption that "adding resources makes it faster" and becomes the basis for judging the limits of horizontal scaling and the need for architectural improvement (sharding, removing lock contention).

The two coefficients of the USL have great diagnostic value in that each points to a different remedy. If the contention coefficient (the fraction of serial processing, linked to Amdahl's law) is large, a shared section that cannot be parallelized (a global lock, a single leader) is the bottleneck, so that section must be split; if the coherency coefficient (the cost of coordination among nodes) is large, the problem is that mutual communication cost grows quadratically as nodes increase, so you must shift to a design that needs no coordination (sharding/partitioning, a share-nothing architecture). By fitting the USL to load-test data to estimate these two coefficients, you can predict in advance up to how many nodes the current architecture effectively scales (the peak-throughput point) and prevent cost waste from over-expansion.

C. Reinterpretation in Asynchronous, Event-Driven Architectures

Modern microservices often convert synchronous calls into message-queue-based asynchronous processing, and queueing theory clearly explains the effect of this conversion. In a synchronous structure, peak load immediately pushes the downstream service's ρ above 1 and invites cascading timeouts, but inserting a message queue makes the queue act as a buffer, leveling the momentary load (load leveling). The consumer processes steadily at its stable service rate μ, and requests piled up at peak stay in the queue and are drained when idle. This is the same principle as absorbing momentary rejection by increasing K (queue capacity) in the M/M/1/K model.

However, going asynchronous does not remove the fundamental constraint ρ<1. If the long-run average arrival rate exceeds the consumer's processing capacity, the queue piles up endlessly and message delay (consumer lag) accumulates, so ultimately you must increase processing capacity by adding consumers (scale-out) or apply backpressure to the producer to suppress the arrival rate. That is, an asynchronous queue absorbs bursts but does not absorb sustained overload—this is the clear boundary queueing theory offers, and monitoring the consumer-lag trend becomes a practical proxy metric for estimating ρ.

D. Combination with Measurement

Recent Observability tools collect utilization, queue length, and sojourn time in real time, so combined with queueing formulas you can predict in operation 'what p99 will be if traffic goes 1.5× at the current ρ'. However, since real IT traffic is often not a perfect Poisson process but takes on autocorrelation/burstiness, a gap may arise between theoretical and measured values. Therefore the model should be used as a 'lens that sees tendencies and limits' rather than an 'accurate prophecy', and important decisions are safest verified by load testing.

One way to implement this combination in practice is to fit an M/M/c curve to a few measured (ρ, response time) points from load testing and then extrapolate the not-yet-measured high-load region with that curve. This way you can estimate the 'critical ρ at which service begins to collapse' without actually suffering an outage, and set auto-scaling thresholds and alarm criteria on a data basis. This collaboration—measurement handling the past, the model handling the future—is the shape of mature performance engineering.

6. Considerations and Implications (Professional Engineer's Perspective)

  1. Design to bind utilization within a safe zone (70–80%). Since latency responds nonlinearly to ρ, a design aiming to pack resources 100% full invites a performance cliff at peak. Treat remaining headroom as a buffer that absorbs variability, and set auto-scaling thresholds and SLAs in line with this principle.
  2. Manage the 'tail latency', not the 'average'. User experience and SLA are decided at p95/p99, and much of tail latency arises from waiting. Reducing the variability (variance) of service time (leveling request sizes, removing slow queries) is as important as shortening the average.
  3. Resource sharing (a common queue) is more advantageous than splitting. Rather than fixedly splitting servers/connections per user/tenant, bundling them into a shared pool to reuse idle resources can reduce waiting time with the same resources. However, since there is a trade-off with fairness/isolation (Noisy Neighbor) needs, complement it with priority queues and quotas.
  4. Horizontal scaling is not infinite (USL). Because of contention/coherency cost, adding servers reduces or even reverses the effect past some point. Before expansion, distinguish whether the bottleneck is a resource shortage or contention, and if the latter, carry out architectural improvement such as sharding and lock removal in parallel. [[consistent-hashing]]
  5. Use theory and measurement together. The queueing model is a lens that extrapolates loads not yet experienced, and real traffic may diverge from theory because of burstiness. Operate capacity planning as a dual system that forms hypotheses with the model and verifies them with load-test and observability data.
  6. Defend against overload with 'rejection'. Under a load exceeding the stability condition (ρ<1), accepting all requests causes the queue to diverge and spread into a full outage. As the finite-queue (M/M/c/K) model implies, it is better to quickly reject requests beyond the acceptance limit (load shedding, admission control) and suppress a retry storm with backoff and circuit breakers—keeping the SLA for the requests accepted is better than a total collapse.

References


In one line: Queueing theory quantifies with probabilistic models the waiting created by the irregularity of arrivals and finiteness of service, predicts response time and capacity with Little's Law and the M/M/c formula, and reveals that latency surges nonlinearly as utilization rises—providing the mathematical foundation for IT performance design and capacity planning.