Tutorials › Stochastic Processes › The Stationary Workload Distribution

The M/M/1 Queue · Tutorial 635 of 994

The Stationary Workload Distribution

Derive the stationary workload distribution, including the probability of zero workload and the exponential tail when the server is busy.

Intermediate 9 min read

What You'll Learn

  • Define workload at an arbitrary time in a stationary M/M/1 queue.
  • Explain why the workload given the number in the system has an Erlang distribution.
  • Derive the atom at zero and the tail rate for positive workload.
  • Find the conditional distribution of workload given that it is positive.
  • Check workload calculations by mixing over the stationary queue length.
  • Identify why using the service rate alone gives the wrong workload tail.

Workload at an Arbitrary Time

Queue length counts customers, while workload measures the service still required to clear them. In an M/M/1 queue, the workload at an arbitrary time includes the remaining service of the customer in service and the full service requirements of customers waiting. It is zero exactly when the server is idle. Its stationary distribution therefore reflects both the stationary number of customers and the exponential service-time assumption.

Work on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). Consider a single-server, first-come-first-served queue with Poisson arrivals of rate \(\lambda>0\), independent service times with exponential distribution of rate \(\mu>0\), and an infinite waiting room. Write \((N_t)_{t\ge0}\) for the number of customers in the system and \((V_t)_{t\ge0}\) for the workload, both in continuous time. Thus \(V_t\) is measured in units of service time. Let \(\rho=\lambda/\mu\). We consider the stationary regime, which exists for this M/M/1 queue when \(\rho<1\).

Definition: At time \(t\), the workload \(V_t\) is the remaining service time of the customer in service, plus the service times required by all customers waiting. If \(N_t=0\), set \(V_t=0\). An arbitrary-time workload distribution means the distribution of \(V_t\) when the queue is in stationarity, not a distribution observed only at customer arrivals.

We use the stationary queue-length probabilities established for the M/M/1 model: \(\mathbb{P}(N_t=n)=(1-\rho)\rho^n\) for \(n=0,1,\ldots\). These probabilities sum to one because \(\sum_{n=0}^{\infty}(1-\rho)\rho^n=1\) when \(0<\rho<1\). The key step is to determine the workload conditional on \(N_t=n\).

Proposition: In stationarity, conditional on \(N_t=n\ge1\), the workload has the same distribution as the sum of \(n\) independent exponential random variables of rate \(\mu\). Its density at \(x>0\) is \(\frac{\mu^n x^{n-1}e^{-\mu x}}{(n-1)!}\).

Proof. If \(n=1\), the customer in service has an exponential service requirement. Conditional on its service age and on the history determining that it is still in service, the memoryless property gives an exponential remaining service time of rate \(\mu\), independent of that age. If \(n>1\), the other \(n-1\) customers are waiting and each has an independent, not-yet-started service requirement with the original exponential distribution. Those service requirements are independent of the remaining service time in progress. Thus the workload conditional on \(N_t=n\) is a sum of \(n\) independent rate-\(\mu\) exponential variables. For \(n=1\), its density is \(\mu e^{-\mu x}\). If the sum of \(n\) such variables has density \(g_n(y)=\mu^n y^{n-1}e^{-\mu y}/(n-1)!\), convolution with one more exponential density gives, for \(x>0\), $$ g_{n+1}(x)=\int_0^x g_n(y)\mu e^{-\mu(x-y)}\,dy =\frac{\mu^{n+1}e^{-\mu x}}{(n-1)!}\int_0^x y^{n-1}\,dy =\frac{\mu^{n+1}x^n e^{-\mu x}}{n!}. $$ This proves the density formula by induction. \(\square\)

The Stationary Workload Law

Theorem: Suppose \(0<\lambda<\mu\) and the M/M/1 queue is in stationarity. Then $$ \mathbb{P}(V_t=0)=1-\rho,\qquad \mathbb{P}(V_t>x)=\rho e^{-(\mu-\lambda)x}\quad (x\ge0). $$ On \(x>0\), the workload has density \(f_V(x)=\rho(\mu-\lambda)e^{-(\mu-\lambda)x}\). In particular, conditional on \(V_t>0\), the workload is exponential with rate \(\mu-\lambda\).

Proof. Write \(V\) for a workload at an arbitrary stationary time. Since the workload is zero exactly when \(N_t=0\), \(\mathbb{P}(V=0)=\mathbb{P}(N_t=0)=1-\rho\). For \(n\ge1\), the proposition gives the conditional density of \(V\) given \(N_t=n\). Therefore, for \(x>0\), the density of the positive part of the workload is the mixture $$ f_V(x)=\sum_{n=1}^{\infty}(1-\rho)\rho^n \frac{\mu^n x^{n-1}e^{-\mu x}}{(n-1)!}. $$ All summands are nonnegative, so the series can be evaluated term by term. Factoring out the terms that do not depend on \(n\) gives $$ f_V(x)=(1-\rho)\rho\mu e^{-\mu x} \sum_{k=0}^{\infty}\frac{(\rho\mu x)^k}{k!} =(1-\rho)\rho\mu e^{-\mu x}e^{\rho\mu x}. $$ Since \(\rho\mu=\lambda\) and \((1-\rho)\mu=\mu-\lambda\), this is \(f_V(x)=\rho(\mu-\lambda)e^{-(\mu-\lambda)x}\). Integrating this density from \(x\) to infinity gives \(\mathbb{P}(V>x)=\rho e^{-(\mu-\lambda)x}\) for \(x\ge0\). At \(x=0\), this tail is \(\rho\), which agrees with \(\mathbb{P}(V>0)=1-\mathbb{P}(V=0)=\rho\). Finally, for \(x\ge0\), $$ \mathbb{P}(V>x\mid V>0)=\frac{\mathbb{P}(V>x)}{\mathbb{P}(V>0)} =\frac{\rho e^{-(\mu-\lambda)x}}{\rho} =e^{-(\mu-\lambda)x}. $$ The conditioning is meaningful because \(\rho>0\). This is the survival function of an exponential random variable with rate \(\mu-\lambda\). \(\square\)

The distribution has two parts: an atom of size \(1-\rho\) at zero and a continuous exponential component on positive workloads. Equivalently, for \(x\ge0\), its cumulative distribution function is \(1-\rho e^{-(\mu-\lambda)x}\). At \(x=0\) this gives \(1-\rho\), not one: the jump there is exactly the idle probability.

Worked Example: Atom and Density with Rates Two and Five

Let the arrival rate be \(\lambda=2\) and the service rate be \(\mu=5\), in consistent units. Here \(\rho=\lambda/\mu=2/5<1\), and \(\mu-\lambda=5-2=3\), so the stationary workload law applies.

The idle probability is \(\mathbb{P}(V=0)=1-\rho=1-2/5=3/5\). For \(x>0\), the density is $$ f_V(x)=\frac25(3)e^{-3x}=\frac65e^{-3x}. $$ For \(x\ge0\), the strict upper tail is \(\mathbb{P}(V>x)=\frac25e^{-3x}\). In particular, at \(x=1\), \(\mathbb{P}(V>1)=\frac25e^{-3}\), while \(\mathbb{P}(V\le1)=1-\frac25e^{-3}\).

Check: The positive-density mass is \(\int_0^\infty \frac65e^{-3x}\,dx=\frac65\cdot\frac13=\frac25\). Adding the atom gives \(\frac25+\frac35=1\), as required.

Worked Example: Conditional Workload When the Server Is Busy

Suppose \(\lambda=3\) and \(\mu=4\). Then \(\rho=3/4\), the idle probability is \(1-\rho=1/4\), and the positive-workload tail rate is \(\mu-\lambda=4-3=1\). At an arbitrary stationary time, the probability that the workload exceeds \(2\) is $$ \mathbb{P}(V>2)=\frac34e^{-(4-3)2}=\frac34e^{-2}. $$

The probability that the server is busy is \(\mathbb{P}(V>0)=3/4\). Thus the conditional probability that workload exceeds \(2\), given that it is positive, is $$ \mathbb{P}(V>2\mid V>0)=\frac{\frac34e^{-2}}{\frac34}=e^{-2}. $$ More generally, conditional on being busy, \(V\) is exponential with rate \(1\) in these units. Its conditional mean is \(1/(4-3)=1\). The unconditional mean is \((3/4)(1)=3/4\), because workload is zero with probability \(1/4\).

Check: The conditional tail at zero is \(e^0=1\), as it must be given \(V>0\). The unconditional tail at zero is \(3/4\), matching the busy probability.

Worked Example: Checking the Mixture over Queue Length

Take \(\lambda=1\) and \(\mu=3\). Then \(\rho=1/3\), \(\mu-\lambda=2\), and \(\mathbb{P}(N_t=n)=(2/3)(1/3)^n\). In particular, \(\mathbb{P}(N_t=2)=(2/3)(1/3)^2=2/27\). Given \(N_t=2\), the workload is a sum of two rate-\(3\) exponentials. Its survival probability at \(x>0\) is \(e^{-3x}(1+3x)\), so at \(x=1\) the contribution from the event \(N_t=2\) to \(\mathbb{P}(V>1)\) is $$ \mathbb{P}(N_t=2)\mathbb{P}(V>1\mid N_t=2) =\frac{2}{27}e^{-3}(1+3) =\frac{8}{27}e^{-3}. $$

To check the whole mixture, the theorem gives \(\mathbb{P}(V>1)=\frac13e^{-2}\). The \(N_t=1\) contribution is \(\mathbb{P}(N_t=1)e^{-3}=(2/9)e^{-3}\), since one rate-\(3\) exponential exceeds \(1\) with probability \(e^{-3}\). Therefore the contribution from all \(n\ge2\) together is \(\frac13e^{-2}-\frac29e^{-3}\), which includes the \(n=2\) contribution just computed.

Check: The contribution from \(n\ge2\) must be at least the contribution from \(n=2\). Their difference is $$ \left(\frac13e^{-2}-\frac29e^{-3}\right)-\frac{8}{27}e^{-3} =\frac13e^{-2}-\frac{14}{27}e^{-3} =\frac{e^{-3}}{27}(9e-14)>0, $$ since \(e>2\) implies \(9e-14>4>0\). The mixture calculation is consistent with the positive contributions of the queue-length states.

Why the Tail Rate Is Not the Service Rate

A frequent error is to treat positive workload as only the remaining service time of the customer currently in service. That residual time is exponential with rate \(\mu\), but a busy system can also have customers waiting, whose service requirements add to the workload. Mixing over the stationary number in the system changes the tail rate from \(\mu\) to \(\mu-\lambda\).

Common mistake. In the first example, using \(\mathbb{P}(V>1)=\rho e^{-\mu}\) would give \(\frac25e^{-5}\). This calculation incorrectly assumes that, whenever the server is busy, there is no additional queued work. The correct calculation mixes over all positive queue lengths and gives \(\frac25e^{-(5-2)}=\frac25e^{-3}\). The discrepancy is not a change in the service-time distribution; it comes from including work waiting behind the customer in service.

The stability condition matters as well. The formula requires \(0<\lambda<\mu\). At \(\lambda=\mu\), substituting into the displayed tail expression would give a tail equal to one for every \(x\ge0\), which cannot be the tail of a finite-valued stationary workload: it would imply \(\mathbb{P}(V>0)=1\) and no decrease in the tail as \(x\) grows. There is no stationary M/M/1 workload distribution in that case, so the formula must not be extended to the boundary.

The key interpretation is that the positive workload, conditional on being nonzero, has an exponential distribution with rate \(\mu-\lambda\), while the probability of a positive workload is \(\rho\). The atom at zero records idle time; the exponential component accounts for the remaining service and all work waiting. Keeping these two parts separate prevents confusion between workload, an individual service time, and queue length.

Check Your Understanding

Use the stationary M/M/1 workload law, and keep the atom at zero distinct from the continuous part.

  1. For \(\lambda=2\) and \(\mu=6\), find the probability of zero workload and the strict tail \(\mathbb{P}(V>1)\).
  2. For \(\lambda=1\) and \(\mu=4\), what is the conditional distribution of \(V\) given \(V>0\)? State its rate.
  3. Explain why the workload conditional on \(N_t=2\) is not just an exponential service time.
  4. For \(\lambda=3\) and \(\mu=5\), verify that the atom at zero plus the integrated positive density equals one.
  5. What fails if one applies the stationary workload formula with \(\lambda=\mu\)?