# Analytic Queueing Theory - Examples

Text: Chapters 30--36.

## Birth-death process

#### The Simplest Example M/M/1

Mean response time: E(r) = (1/\lambda) * E(n) = 1 / (\mu - \lambda) = 1 / (\mu (1-r))

#### Another Example: M/M/2 & M/M/m

Mean response time: E[r] = (1/\lambda) E[n] = 1/ (\mu (1-r^2))

Compare this result to two independent servers each of which has reponse time 1 / (\mu (1-r))

#### Example 3. M/M/1/B

B stands for finite buffer, and B is its size, which includes the job being served.

1. Maximum number of jobs in the system is B. Therefore stable.
2. \lambda_j = \lambda when j < B & \lambda_j = 0 when j >= B
3. \mu_j = \mu
4. pn = p0 r^n when n <= B; pn = 0 otherwise
5. \sum pn = 1 = p0 sum^B r^n = (1 - r^(B+1)) / (1-r) when r != 1. When r = 1, \sum pn = B+1.

Can talk about an effective rate.

How to do the sum:

1. S(B) = sum_(n=0)^B r^n = sum_n^inf r^n - \sum_(n=B+1)^inf r^n
2. S(B) = 1/(1-r) -r^(B+1) \sum_n r^n = (1-r^(B+1)) / (1-r)

#### Example 4. M/M/1/Infinity/N

• N stands for number of users.
• This is a closed model with a think time
• The first M is not exponential interarrival time, but exponential think time.

What are \lambda_j and \mu_j?

• \lambda_j = (N-j) \lambda:
• Any user without a job in the system can submit one at any moment.
• All users are the same.

\mu_j = \mu

• All jobs pass through the same server.
   j          0             1               N-1     N
\lambda_j   N\lambda  (N-1)\lambda  ...  \lambda    0  ...
\mu_(j+1)    \mu           \mu              \mu    n/a

1. p1 = N r p0
2. p2 = N(N-1) r^2 p0
3. ...
4. pn = (N! / (N-n)!) r^n p0

We can write down a nice looking expression, but we cannot sum it.

• Write a few expression in terms of p0
• Remember E[r] = N/X - Z where Z = 1/\lambda and X = \mu(1-p0)
• E[r] = N / (\mu(1-p0) - 1/\lambda
• E[n] = \lambda E[r] = N r / (1-p0) - 1

Here is a very rough approximation to p0

• p0^(-1) = \sum^N N^n r^n = (1 - (Nr)^(N+1) ) / (1 - Nr)
• p0 = (1-Nr) / ( 1 - (Nr)^(N+1) )
• 1 - p0 = Nr ( 1 - (Nr)^N ) / ( 1 - (Nr)^(N+1) )
• E[n] = ( 1 - (Nr)^(N+1) ) / ( 1 - (Nr)^N ) - 1 = (Nr)^N

### More General Markov Processes

Solution method

1. Draw state transition diagram
2. Obtain balance condition equations: rate in equals rate out
3. Solve balance equations with normalizing equation
• \sum pn = 1
4. Determine performance metrics from pn

Simple in principle. May be complex in practice.

Return to: