5.5 Queues

A queue is a birth and death process in which births are arrivals and deaths are departures. A queueing system is described by its arrival process, its service mechanism (the number of servers and the distribution of service times) and its queue discipline (for example first come first served). With Poisson arrivals and exponential service times, the number in the system \(X(t)\) is a continuous-time Markov chain, and if it is irreducible and positive recurrent then \(P_j(t) = P(X(t) = j)\) tends to a limit \(p_j\), the same whatever the initial state. The system is then in statistical equilibrium, and since \(P_j(t)\) settles down, \(P_j'(t)\to 0\). So the long-run probabilities are found by setting the derivatives in the differential equations to zero.

Example 5.5.1 (One server, no waiting room). Customers arrive as a Poisson process with rate \(\lambda \) at a single server, and service times are exponential with rate \(\mu \). A customer who finds the server busy leaves at once. Find the equilibrium distribution of the number in the system.

Solution. The state is \(0\) (idle) or \(1\) (busy). The system is idle at \(t + h\) if it was idle and no customer arrived, or busy and the service finished: \[P_0(t + h) = P_0(t)(1 - \lambda h) + P_1(t)\mu h + o(h),\qquad P_0'(t) = -\lambda P_0(t) + \mu P_1(t) .\] In equilibrium \(0 = -\lambda p_0 + \mu p_1\), so \(p_1 = \frac \lambda \mu p_0\), and with \(p_0 + p_1 = 1\), \[p_0 = \frac {\mu }{\lambda + \mu },\qquad p_1 = \frac {\lambda }{\lambda + \mu } .\] By the Poisson arrivals, a fraction \(p_1 = \frac {\lambda }{\lambda + \mu }\) of all customers is lost.

Example 5.5.2 (A shoe-shine stand). Customers arrive at a shoe-shine stand at rate \(10\) per hour. There is one attendant, the mean shine takes \(6\) minutes, and there is one waiting chair; customers who find both chairs taken go away. Assuming Poisson arrivals and exponential service, find the equilibrium distribution of the number of customers present, and the proportion of customers lost.

Solution. Here \(\lambda = 10\) and \(\mu = 10\) per hour, and the states are \(0\), \(1\) and \(2\). The balance equations, obtained by setting the derivatives to zero, are \[-10p_0 + 10p_1 = 0,\qquad 10p_0 - 20p_1 + 10p_2 = 0,\] so \(p_1 = p_0\) and \(p_2 = 2p_1 - p_0 = p_0\). With \(p_0 + p_1 + p_2 = 1\), the equilibrium distribution is \(\left (\frac 13, \frac 13, \frac 13\right )\). Arrivals who find two customers present are lost, so one third of the customers go away.

Example 5.5.3 (The M/M/1 queue). Customers arrive at a single server as a Poisson process with rate \(\lambda \), wait in line if the server is busy, and are served in order of arrival; service times are independent exponential with rate \(\mu \). Find the equilibrium distribution of the number in the system and its mean.

Solution. With \(n\geq 1\) customers present, the next change is an arrival at rate \(\lambda \) or a departure at rate \(\mu \), so \[P_0'(t) = -\lambda P_0(t) + \mu P_1(t),\qquad P_n'(t) = -(\lambda + \mu )P_n(t) + \lambda P_{n-1}(t) + \mu P_{n+1}(t),\quad n\geq 1 .\] In equilibrium, \(\mu p_1 = \lambda p_0\) and \(\mu p_{n+1} - \lambda p_n = \mu p_n - \lambda p_{n-1}\) for \(n\geq 1\). The quantity \(\mu p_{n+1} - \lambda p_n\) is therefore the same for all \(n\), and it is \(0\) at \(n = 0\); so \(p_{n+1} = \rho p_n\) with \(\rho = \frac \lambda \mu \), and \(p_n = \rho ^np_0\). These sum to \(1\) only if \(\rho <1\), and then \[p_n = (1 - \rho )\rho ^n,\qquad n = 0, 1, 2, \dots ,\] a geometric distribution. The mean number in the system is \(L = \sum _nnp_n = \frac {\rho }{1 - \rho } = \frac {\lambda }{\mu - \lambda }\). The server is busy a fraction \(1 - p_0 = \rho \) of the time, \(\rho \) is called the traffic intensity, and the queue is stable only when customers arrive more slowly than they can be served.

For example, with \(\lambda = 8\) and \(\mu = 10\) per hour, \(\rho = 0.8\), the server is idle \(20\%\) of the time, and the mean number present is \(\frac {0.8}{0.2} = 4\). Raising the arrival rate to \(9.5\) per hour, a rise of under \(20\%\), gives \(\rho = 0.95\) and a mean of \(19\): congestion grows sharply as \(\rho \to 1\).

Example 5.5.4 (An infinite-server queue). Customers arrive as a Poisson process with rate \(\lambda \), and each is served at once by its own server, service times being exponential with rate \(\mu \); with \(j\) customers present, the probability that one completes service in \((t, t + h]\) is \(j\mu h + o(h)\). Find the equilibrium distribution.

Solution. The balance equations are \(\mu p_1 = \lambda p_0\) and, as for the M/M/1 queue but with departure rate \((n + 1)\mu \) from state \(n + 1\), \((n + 1)\mu p_{n+1} = \lambda p_n\). So \(p_n = \frac {(\lambda /\mu )^n}{n!}p_0\), and summing, \(p_0 = e^{-\lambda /\mu }\): \[p_j = \frac {e^{-\lambda /\mu }(\lambda /\mu )^j}{j!},\qquad j = 0, 1, 2, \dots .\] The number of customers present is Poisson with mean \(\frac \lambda \mu \), the arrival rate times the mean service time.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.