# M/M/1/FIFO queue with multiple streams, delay of each stream?

Suppose that you have an M/M/1/FIFO queue where jobs arrive with two poisson arrival processes P1, P2. The service rate of the queue is $\mu$. The arrival rate of P1 and P2 is $\lambda_1$ and $\lambda_2$ respectively.

What is the mean delay for the jobs of each process?

If I let:

$\lambda \equiv \lambda_1 + \lambda_2$

be the total arrival rate and

$D \equiv \frac{1}{\mu-\lambda}$

be the mean delay for any job in the queue

then I have the intuition that the mean delay of packets from the first process should be

$D_1 = \frac{1}{\mu\frac{\lambda_1}{\lambda}-\lambda_1} = \frac{\lambda}{\lambda_1} D$

because the packets of the first flow should be serviced $\frac{\lambda_1}{\lambda}$ % of the time. However, I think this is wrong because if I take the mean delay between the proceses:

$D' \equiv \frac{\lambda_1}{\lambda} D_1 + \frac{\lambda_2}{\lambda} D_2 = 2D$

which can't be the case so I'm doing something wrong. So what is it/ where can I find an analysis?

Edit: I'm interested in the mean delay of a job of P1(P2) when both processes act on the queue.

• The superposition of two Poisson processes with rates $\lambda_1$ and $\lambda_2$ is again a Poisson process with rate $\lambda_1+\lambda_2$ (prove this fact if you have not already). So your system is no different than the standard $M/M/1$ queue. Feb 17 '20 at 12:57
• Poisson arrivals see time averages (PASTA). So, on average, jobs from both streams "see" the same unfinished work in front of them. So they have the same average delay in the queue. And since the service distributions are the same, overall they both have the same total average delay, which is $1/(\mu-\lambda)$. Here I am assuming the two Poisson processes are independent so the total process is again Poisson. Aug 2 at 0:30

Suppose that there are two Poisson processes operating independently, with arrival rates $\lambda_1$ and $\lambda_2$ respectively. $N_{1}(t)$ and $N_{2}(t)$ are the respective cumulative numbers of arrivals through time t. Then the combined or pooled process has a cumulative number of arrivals equal to $N(t) = N_{1}(t)) + N_{2}(t)$. A fundamental property of independent Poisson processes is that their pooled process is also a Poisson process with arrival-rate parameter equal to the sum of the individual arrival rates. Thus, N(t) has a Poisson distribution with mean $(\lambda_1 + \lambda_2)t$.

The mean delay of the pooled process = $D = \frac{1}{\mu - \lambda} = \frac{1}{\mu - \lambda_1 - \lambda_2}$. Get $\mu$ from this in terms of D and respective $\lambda$

That will be $\mu = \frac{1}{D} +\lambda$

For the independent process if it were to act independently with the server would have a mean delay such as this

$$D_1 = \frac{1}{\mu - \lambda_1}$$ $$D_2 = \frac{1}{\mu - \lambda_2}$$

Substitute the value of $\mu$ in this and you would get

$$D_1 = \frac{D}{(1+D\lambda_2)}$$

$$D_2 = \frac{D}{(1+D\lambda_1)}$$

Now equate in the result $D = D_1 +D_2$

You get $D = \frac{1}{\sqrt{\lambda_1 \lambda_2}}$

Substituting the value of D in the equation of $D_1$ and $D_2$

The mean delay of the two processes are

$$D_1 = \frac{1}{\mu-\lambda_1} = \frac{1}{\sqrt{\lambda_1 \lambda_2}+\lambda_2}$$ $$D_2 = \frac{1}{\mu-\lambda_2} = \frac{1}{\sqrt{\lambda_1 \lambda_2}+\lambda_1}$$

That is going to solve your worry of $D = D_1 + D_2$

• Thank you for your answer! But I don't think I follow. According to your solution $\mu = \sqrt{\lambda_1 \lambda_2} +\lambda_1 + \lambda_2$ This implies that $\mu$ is dependent on $\lambda_1$ and $\lambda_2$ which is not the case in general. Perhaps I didn't express what I want well enough, I'm interested in the mean delay of a job of a single stream, when both streams arrive at the queue, not when they act independently with the queue. Jan 13 '15 at 14:05
• I think my answer would have been misleading. But I wonder if you have an answer that I can check against. I am extending same concept where delay for each process is $\frac{1}{\mu-c_1\lambda}$ and $\frac{1}{\mu-c_2\lambda}$ and that $c_1+c_2 = 1$ and D = $\frac{1}{\mu-\lambda}$ and that $D = D_1 +D_2$. Now solve it for $c_1$ and $c_2$. I am getting a more than normal solution (complex) (not complex number). If you know the answer, let me know and I can check. Jan 13 '15 at 15:12
• I researched and I could not find anything that is useful in the internet. The only thing that came close was merging of two poisson process for which there is no literature in the internet that would give the delay for each arrival process. Thanks Jan 13 '15 at 15:17