Fiveable

๐Ÿ”€Stochastic Processes Unit 8 Review

QR code for Stochastic Processes practice questions

8.4 M/G/1 and G/M/1 queues

8.4 M/G/1 and G/M/1 queues

Written by the Fiveable Content Team โ€ข Last updated August 2025
Written by the Fiveable Content Team โ€ข Last updated August 2025
๐Ÿ”€Stochastic Processes
Unit & Topic Study Guides

M/G/1 queue

The M/G/1 queue models a single-server system where arrivals are Poisson (Markovian) but service times can follow any distribution. This flexibility makes it one of the most widely used queueing models, since real service processes rarely have neat exponential distributions. The "M/G/1" notation follows Kendall's convention: Markovian arrivals / General service / 1 server.

Poisson arrivals

Customers arrive according to a Poisson process with rate ฮป\lambda. This means inter-arrival times are i.i.d. exponential random variables with mean 1/ฮป1/\lambda. The memoryless property of exponential inter-arrivals is what makes the arrival side tractable: the future arrival process doesn't depend on how long you've been waiting since the last arrival.

General service times

Service times are i.i.d. random variables drawn from a general distribution with:

  • Mean E[S]=1/ฮผE[S] = 1/\mu
  • Second moment E[S2]E[S^2]
  • Variance ฯƒS2=E[S2]โˆ’(1/ฮผ)2\sigma_S^2 = E[S^2] - (1/\mu)^2

The distribution can be anything: exponential, deterministic, Erlang, hyperexponential, Pareto, etc. This generality is the whole point of the model. The key requirement for stability is that the traffic intensity satisfies ฯ=ฮป/ฮผ<1\rho = \lambda / \mu < 1.

Embedded Markov chain

Because service times are general, the system state doesn't form a continuous-time Markov chain. The standard trick is to observe the system only at service completion epochs. Let QnQ_n be the number of customers left behind by the nn-th departing customer. Then:

Qn+1=(Qnโˆ’1)++An+1Q_{n+1} = (Q_n - 1)^+ + A_{n+1}

where (x)+=maxโก(x,0)(x)^+ = \max(x, 0) and An+1A_{n+1} is the number of Poisson arrivals during the (n+1)(n+1)-th service time. Since arrivals are Poisson and service times are i.i.d., {Qn}\{Q_n\} forms a Markov chain. Steady-state probabilities are found by solving the resulting balance equations, typically via generating functions.

Pollaczek-Khinchine (P-K) formula

This is the central result for M/G/1. It gives the mean number of customers in the system in closed form:

E[L]=ฯ+ฯ2+ฮป2ฯƒS22(1โˆ’ฯ)E[L] = \rho + \frac{\rho^2 + \lambda^2 \sigma_S^2}{2(1 - \rho)}

An equivalent form, written in terms of E[S2]E[S^2]:

E[L]=ฯ+ฮป2E[S2]2(1โˆ’ฯ)E[L] = \rho + \frac{\lambda^2 E[S^2]}{2(1 - \rho)}

Notice that the mean queue length depends not just on the mean service time but also on its second moment (or equivalently, its variance). Two service distributions with the same mean but different variances will produce different queue lengths. Higher variance means longer queues.

The P-K formula also has a generating-function version that gives the full distribution of queue length, not just the mean. The formula above is obtained by differentiating that generating function and evaluating at z=1z = 1.

Mean waiting time (P-K mean value formula)

The average time a customer waits in the queue (before service begins) is:

E[Wq]=ฮปE[S2]2(1โˆ’ฯ)E[W_q] = \frac{\lambda E[S^2]}{2(1 - \rho)}

You can derive this from E[Lq]=ฮปE[Wq]E[L_q] = \lambda E[W_q] (Little's law applied to the queue portion) combined with the P-K formula. The total time in the system (waiting plus service) is:

E[W]=E[Wq]+E[S]=ฮปE[S2]2(1โˆ’ฯ)+1ฮผE[W] = E[W_q] + E[S] = \frac{\lambda E[S^2]}{2(1 - \rho)} + \frac{1}{\mu}

And by Little's law for the whole system, E[L]=ฮปE[W]E[L] = \lambda E[W], which is consistent with the P-K formula above.

Busy period

A busy period starts when an arriving customer finds the server idle and ends when the server next becomes idle. Let E[B]E[B] denote the mean busy period. By a renewal argument:

E[B]=1/ฮผ1โˆ’ฯ=E[S]1โˆ’ฯE[B] = \frac{1/\mu}{1 - \rho} = \frac{E[S]}{1 - \rho}

The full distribution of the busy period can be characterized through its Laplace-Stieltjes transform (LST), which satisfies a functional equation involving the LST of the service time distribution.

Poisson arrivals, Poisson Process and Its Application to the Storm Water Overflows

G/M/1 queue

The G/M/1 queue flips the generality: inter-arrival times follow a general distribution, while service times are exponential. The notation is General arrivals / Markovian service / 1 server.

General inter-arrival times

Consecutive inter-arrival times are i.i.d. with a general distribution:

  • Mean E[A]=1/ฮปE[A] = 1/\lambda
  • The distribution can be deterministic, Erlang, hyperexponential, etc.

Exponential service times

Service times are exponentially distributed with rate ฮผ\mu (mean 1/ฮผ1/\mu). The memoryless property of exponential service is what makes the service side tractable here, just as memoryless arrivals made the arrival side tractable in M/G/1.

Stability again requires ฯ=ฮป/ฮผ<1\rho = \lambda/\mu < 1.

Embedded Markov chain

For G/M/1, the natural embedding points are arrival epochs (not departure epochs as in M/G/1). Let QnQ_n be the number of customers found in the system by the nn-th arriving customer. Because service times are exponential, the number of service completions during a general inter-arrival time depends only on how many customers are present and the inter-arrival duration. This makes {Qn}\{Q_n\} a Markov chain.

The root ฯƒ\sigma and steady-state distribution

The steady-state distribution of the number of customers seen by an arriving customer has a geometric-like form:

ฯ€k=(1โˆ’ฯƒ)ฯƒk,k=0,1,2,โ€ฆ\pi_k = (1 - \sigma)\sigma^k, \quad k = 0, 1, 2, \ldots

where ฯƒ\sigma is the unique root in (0,1)(0, 1) of the equation:

ฯƒ=A~(ฮผโˆ’ฮผฯƒ)\sigma = \tilde{A}(\mu - \mu\sigma)

Here A~(s)\tilde{A}(s) is the Laplace-Stieltjes transform of the inter-arrival time distribution, i.e., A~(s)=E[eโˆ’sA]\tilde{A}(s) = E[e^{-sA}]. Finding ฯƒ\sigma is typically done numerically.

The fact that the queue-length distribution is geometric (in the arriving customer's view) is a distinctive feature of G/M/1. Compare this with M/G/1, where the distribution is generally not geometric.

Waiting time distribution

The waiting time in queue (before service begins) for a customer who arrives to find the system in steady state is:

P(Wq=0)=1โˆ’ฯƒP(W_q = 0) = 1 - \sigma

P(Wq>t)=ฯƒโ€‰eโˆ’ฮผ(1โˆ’ฯƒ)t,t>0P(W_q > t) = \sigma \, e^{-\mu(1-\sigma)t}, \quad t > 0

So the conditional waiting time (given that you do wait) is exponential with rate ฮผ(1โˆ’ฯƒ)\mu(1 - \sigma). The mean waiting time in queue is:

E[Wq]=ฯƒฮผ(1โˆ’ฯƒ)E[W_q] = \frac{\sigma}{\mu(1 - \sigma)}

Poisson arrivals, The Exponential Distribution | Introduction to Statistics

M/G/1 vs G/M/1 queues

FeatureM/G/1G/M/1
ArrivalsPoisson (rate ฮป\lambda)General distribution
ServiceGeneral distributionExponential (rate ฮผ\mu)
Embedding pointService completionsArrivals
Key parameterE[S2]E[S^2] (second moment of service)ฯƒ\sigma (root of LST equation)
Queue-length formNot geometric in generalGeometric: (1โˆ’ฯƒ)ฯƒk(1-\sigma)\sigma^k
Central formulaPollaczek-Khinchineฯƒ=A~(ฮผโˆ’ฮผฯƒ)\sigma = \tilde{A}(\mu - \mu\sigma)
Stability conditionฯ=ฮป/ฮผ<1\rho = \lambda/\mu < 1ฯ=ฮป/ฮผ<1\rho = \lambda/\mu < 1

Why the analysis techniques differ

In M/G/1, the exponential (memoryless) arrivals let you embed at departures: the number of arrivals during a service time depends only on the service duration, not on history. In G/M/1, the exponential (memoryless) service lets you embed at arrivals: the number of completions during an inter-arrival gap depends only on the current queue size and the gap length. Each model exploits the memoryless property on whichever side has it.

Role of higher moments

For M/G/1, performance depends on the variance (or second moment) of service times. Two systems with the same mean service time but different variances will behave very differently. For G/M/1, the entire inter-arrival distribution enters through its LST, but the key summary is the single parameter ฯƒ\sigma. In both cases, the mean alone is not enough to determine system performance.

Applications of M/G/1 and G/M/1 queues

Computer systems

  • M/G/1 for CPU scheduling: Job processing times are often heavy-tailed or multi-modal, not exponential. The M/G/1 model captures this while keeping Poisson job submissions.
  • G/M/1 for bursty traffic: When request arrivals are correlated or non-Poisson (e.g., web server traffic with heavy-tailed inter-request times), G/M/1 with exponential processing is a reasonable first model.

Manufacturing

Production lines where machine processing times are deterministic or Erlang-distributed fit naturally into M/G/1 (with Poisson order arrivals). The P-K formula directly shows how service time variability affects work-in-process inventory.

Telecommunications

Packet switches and routers often have fixed or bimodal packet sizes (general service), with Poisson packet arrivals as a first approximation. M/G/1 is the standard model for analyzing packet delay in such systems. G/M/1 applies when the arrival process is the non-standard part, e.g., scheduled or periodic transmissions with exponential processing.

Service operations

Call centers, bank tellers, and hospital triage all involve service times that are clearly not exponential (some calls are quick, others take much longer). M/G/1 captures this heterogeneity. The P-K formula quantifies exactly how much the variability in service times costs you in terms of longer waits.