next up previous
Next: Extension to Multiple Servers Up: No Title Previous: No Title

Number of Processes in a System

A first objective in analyzing a system is to determine how many processes are present at any given time, since the number of processes (roughly) determines the load on the system and the waiting time for each process. Clearly, the number of processes will fluctuate continually, sometime going down to zero, sometime growing to very large values. We cannot predict the fluctuations and thus are only interested in steady-state (long-term, ``average'') values. If the number of processes is the only figure of interest, we can characterize the state of the system simply by the number of processes present, with the result that a system can be in one of states tex2html_wrap_inline137 , tex2html_wrap_inline139 , tex2html_wrap_inline141 , tex2html_wrap_inline143 , tex2html_wrap_inline141 , where the system's being in state tex2html_wrap_inline143 denotes the presence of n processes. A process leaves the system on completion; new processes enter the system; thus transitions take place between the various states. If we observe the system at small enough intervals of time, say every tex2html_wrap_inline151 units of time, then at most one event can take place between any two observations: a single process completion or a single process arrival. Hence a transition from state tex2html_wrap_inline153 can only lead to one of states tex2html_wrap_inline155 (due to a completion) or tex2html_wrap_inline157 (due to an arrival). The resulting state diagram is pictured below.

The next problem is to place some rates (probabilities) on these state transitions. We can observe the system for a while and estimate the process arrival rate, at some number tex2html_wrap_inline159 of processes per unit time. (Viewed differently, tex2html_wrap_inline161 is the expected time between consecutive arrivals.) Similarly, we can deduce from observation the average number of processes completed per unit time, tex2html_wrap_inline163 , in the current system--and scale the value as needed for a system of higher or lower performance. Note that the quantity tex2html_wrap_inline165 now denotes the expected number of processes completed within an interval of tex2html_wrap_inline151 time units; if we let that interval become the infinitesimally small dt of calculus, then tex2html_wrap_inline171 is the probability of a completion within dt time units.

These values normally fluctuate quite a bit; we shall make two assumptions to allow us to treat them as constants:

The latter property is called the memoryless property and is a fundamental approximation in most of queueing analysis--it leads to so-called Markov models, which are mostly amenable to analysis, whereas systems with ``memory'' lead to intractable models. The former property, as we shall shortly see, is only a minor convenience--we can easily dispense with it and use state-dependent rates, at the expense of messier formulae.

Now consider again our state diagram. We can associate a probability with each state: tex2html_wrap_inline179 will denote the probability of the system's being in state tex2html_wrap_inline153 , i.e., the probability of there being i processes in the system. Clearly, the system must be in one of the states tex2html_wrap_inline137 , tex2html_wrap_inline139 , tex2html_wrap_inline141 , so that we can write

displaymath13

Since we want to analyze our system in its steady-state, there cannot be any ``drift'' in the system; put more formally, the probability of moving out of a state must equal the probability of moving into that state. For state tex2html_wrap_inline153 (i>0), this can be written as

displaymath17

In this equation the left-hand side is the probability of leaving state tex2html_wrap_inline153 (through either a completion or an arrival), while the right-hand side is the probability of entering state tex2html_wrap_inline153 , either by being in state tex2html_wrap_inline155 and experiencing an arrival or by being in state tex2html_wrap_inline157 and experiencing a completion. State tex2html_wrap_inline137 has a simpler equation associated with it, since there is no state tex2html_wrap_inline205 :

displaymath24

A bit of algebra shows that all of these equations can be put in the form

displaymath26

or simply

displaymath30

where tex2html_wrap_inline207 is the utilization ratio of the system. (Notice that, if we had state-dependent transition rates, the only change would be that each equation would have its own value of tex2html_wrap_inline209 ; i.e., we would have a system of equations of the type tex2html_wrap_inline211 and thus tex2html_wrap_inline213 .)

Now we have a system of equations given by

displaymath37

with the ``binding'' equation

displaymath13

Substituting the former in the latter, we get

displaymath43

or

displaymath47

We know from discrete mathematics that the infinite sum in the denominator converges for tex2html_wrap_inline215 :

displaymath51

and diverges (grows to infinity) otherwise. We can thus conclude that, for tex2html_wrap_inline215 , we have tex2html_wrap_inline219 , while, for tex2html_wrap_inline221 , we have tex2html_wrap_inline223 . (With state-dependent rates, we cannot write such clean formulae, but the derivations remain the same.)

The probability distribution tex2html_wrap_inline219 is a geometric distribution; we can look at tex2html_wrap_inline179 as the probability of turning up i heads before turning up a tail in i+1 coin flips (so-called Bernoulli trials), where the coin is slightly biassed (instead of having a 50-50 chance of turning up a head, it has a tex2html_wrap_inline209 probability of doing so). Strictly speaking, we have defined a Bernoulli arrival process, where the interarrival time obeys a geometric distribution. These are the discrete versions of the continuous arrival process known as a Poisson process and the continuous distribution known as the exponential distribution. Our setting is discrete, since the number of processes in the system at any given time must be an integer; however, you will often see ``Poisson process'' used in a discrete setting in lieu of the more correct ``Bernoulli process.'' While we are on the unimportant topic of terminology, the queueing system we are considering is generally symbolized as M/M/1, indicating that the arrival process is of type M (Markov, or memoryless), the departure process is also of type M, and there is 1 server. It can be proved that the memoryless property implies an exponential or geometric distribution.

Note that, somewhat surprisingly, the system is not stable when arrivals and departures are perfectly matched ( tex2html_wrap_inline235 ). What happens is best understood by considering a system where we would also have states tex2html_wrap_inline205 , tex2html_wrap_inline239 , tex2html_wrap_inline141 ; in that system, perfectly matched tex2html_wrap_inline163 and tex2html_wrap_inline159 give rise to good behavior (as you are invited to verify), because the system is allowed to move into ``negative states'' and thus accumulate a reserve. In the real system, once the number of processes drops to zero, every unit of time until the next arrival is wasted time: the system is idle and cannot accumulate any reserves, yet we know that, since tex2html_wrap_inline235 , the system needs to be active every unit of time just to keep up. Hence, somewhat paradoxically, every time the system returns to idle, it gets farther behind! \ You can run a simulation of this behavior by yourself by using a coin: mark a line (a sidewalk will do, if you don't mind displaying strange behavior in public!) and move one step forward for each toss that turns up a head and one step backwards for each toss that turns up a tail. On average, you will never wander very far from your point of departure. Now, change the rules by disallowing backward steps whenever you have returned to your starting point; the new rules now model our computer system and you will find that you wander farther and farther away from your departure point.

From our solution for the probabilities, we can compute the average number of jobs in the system; it is given simply by

displaymath58

Again, the infinite sum converges for tex2html_wrap_inline215 ; we can easily show that we have

displaymath67

so that the average number of jobs in the system is

displaymath72

Notice that, as expected, this number grows infinitely large as tex2html_wrap_inline209 approaches 1.

In most systems, however, our assumption of an unbounded queue of processes is unrealistic. Most systems have bounded queues and buffers and will simply reject any new process when their queue or buffer is full. Assume that we have a queue of size k and that any arrival when in state tex2html_wrap_inline255 is simply discarded. How do our previous derivations change? Well, state tex2html_wrap_inline255 , like state tex2html_wrap_inline137 , has a simplified equation; but otherwise, all of our equations hold, with the sum taken from from i=0 to i=k rather than to tex2html_wrap_inline265 . Elementary discrete math tells us that

displaymath76

(It no longer matters that tex2html_wrap_inline209 may exceed 1, since extra processes, instead of enlarging the queue, just get discarded.) Plugging that value into our equation for tex2html_wrap_inline179 , we get

displaymath80

Notice that, as expected, this formula reduces to our earlier one if we assume tex2html_wrap_inline215 and take the limit for tex2html_wrap_inline273 . Likewise, we can compute the average number of process in the system, call it tex2html_wrap_inline275 :

displaymath84

Discrete mathematics tells us that the finite sum tex2html_wrap_inline277 can be reduced to

displaymath93

from which we get our expected number of processes in the system

displaymath98

Notice again that this formula reduces to that for tex2html_wrap_inline279 if we assume tex2html_wrap_inline215 and take the limit for tex2html_wrap_inline273 .

Knowing both tex2html_wrap_inline279 and tex2html_wrap_inline275 , we can find out the fraction of processes that are discarded, simply by computing (for tex2html_wrap_inline215 )

displaymath106

Notice that, as expected, the percentage of discarded processes decreases as k increases; in particular, in the limit as k grows to infinity, no process is discarded ( tex2html_wrap_inline295 ).

Another useful value we want to know is the average time spent in the system by a job, call it W. One reasonable guesstimate would be the product of the average number of jobs in the system, tex2html_wrap_inline279 , by the time required for completion of a job, tex2html_wrap_inline301 (because the system completes tex2html_wrap_inline163 jobs per unit time); thus we would write tex2html_wrap_inline305 . Actually, while reasonable, this is not the correct derivation. The formal derivation, unfortunately, is very complex, unlike what we have done so far; on the other hand, the result is just as simple: the correct formula, known as Little's law, is

displaymath307

Thus, it is the arrival rate, not the departure rate, that we need. If you look at the formula, it does make intuitive sense: the number of jobs in the system should indeed be the ratio of the time spent in the system by a job to the time between new arrivals.


next up previous
Next: Extension to Multiple Servers Up: No Title Previous: No Title


Thu Feb 20 07:57:47 MST 1997