Download presentation
Presentation is loading. Please wait.
1
Chapter 6 Queueing Theory
Prof. Bob Li
2
Typical queueing system are B-D processes
M/M/s M/G/ M/M/1/blocking M/D/1 Interarrival time Memoryless, General, Deterministic, Uniform, etc. Service time is Number of servers, where s . Queueing discipline (optional) Assumptions and notation. Inter-arrival times are i.i.d. The mean is 1/, while the distribution depends on the “1st letter” of queueing model. An “M” Def-C of Poisson process. Service times are i.i.d. The mean is 1/, while the distribution depends the “2nd letter.” An “M” means exponential service time. All inter-arrival times and service times are independent.
3
Typical queueing system are B-D processes
M/M/s M/G/ M/M/1/blocking M/D/1 Interarrival time Memoryless, General, Deterministic, Uniform, etc. Service time is Number of servers, where s . Queueing discipline (optional) Inter-arrival times are i.i.d. with the mean 1/. Service times are i.i.d. with the mean 1/. That is, is the capacity of a server. / = average number of arrivals in a service time = minimum number of servers needed to handle the traffic load = the offered load Because / is a dimensionless quantity, the telecom community gives it the artificial unit “erlang.” So, one can say something like “an M/M/2/blocking queue loaded with 1.6 erlangs”
4
6.1 Cost equations, Little’s formula, & steady state
Prof. Bob Li
5
Four fundamental measures of cost
Each of the following fundamental quantities represents a way to measure the “cost of queueing” in the long run: LQ = Average Queue Length (not including customers that are being served) L = Average population = Average number of customers in the system // LQ and L are time-averages, i.e., averages over all nanoseconds until eternity. WQ = Average Queueing time of a customer W = Average delay of a customer // WQ and W are averages over customers = WQ + 1/ // Delay = queueing + a service time // In this formula, 1/ = mean service time. Later // Later when sometimes stands for average output rate, // then W = WQ + 1/ only for single-server system. Prof. Bob Li
6
Four fundamental measures of cost
Besides W = WQ + 1/, two Little’s Formulas establish two more relations among these four measures of cost so that any of them determines the others. Little’s Formula 1: L = W L W W = WQ + 1/ (1/ = mean service) LQ WQ Little’s Formula 2: LQ = WQ Prof. Bob Li
7
Little’s Formula 1 Little’s Formula 1. L = W for all stationary queueing models. // All stationary models regardless of the arrival process, // service-time distribution, number of servers, and queueing discipline Proof. Think of a measure of the cost as money that customers pay to the system. In this proof, let each customer in the system pay to the system at the rate of $1 per unit time. L = Time-average “rate” at which the system earns // Unit of this “rate” = $/unit time = Average payment per customer when in the system // Time-ave ave over customers ; Unit of this average = $/person = W // Unit = (person/unit time)•($/person) = $/unit time Prof. Bob Li
8
Little’s Formula 2 Little’s Formula 2. LQ = WQ for all stationary queueing models. Proof. Let each customer in queue pay $1 per unit time to the system. LQ = Time-average “rate” at which the system earns = Average amount a customer pays in queue = WQ Prof. Bob Li
9
Four fundamental measures of cost
We have established relations among these four measures of cost so that any of them determines the other three. Little’s Formula 1: L = W L W W = WQ + 1/ (1/ = mean service) LQ WQ Little’s Formula 2: LQ = WQ Homework. Derive the formula L = LQ + / directly. That is, explain why / is the time-average of the number of customers being served. L = LQ + / Prof. Bob Li
10
Lecture 10 April 3, 2013 Prof. Bob Li
11
6.2 Time average of population in Q
Prof. Bob Li
12
3 kinds of limiting distributions of population
N(t) = population of the queueing system at time t Pn = , where n 0 = The proportion of time (in the long run) when there are exactly n customers in the system = Time average // = Average from the outsider’s view an = Proportion of customers (in the long run) that, upon arrival, see exactly n in the system, n 0 = Arrival-time average // Average over customers rather than time = dn = Proportion of customers (in the long run) leaving behind n others to the system upon departure, n 0 = Departure-time average // Average over customers rather than time
13
Handicap on arrival- & departure-time averages
The three kinds of averages {Pn}n0, {an}n0, and {dn}n0 are all limiting distributions of population. They are the same under suitable assumptions in the sequel but, in general, may differ from each other: Think of the time average as the fair average. The arrival-time average, as a quantity, incurs the handicap of not counting the arriving customer himself // Not seeing oneself Symmetric handicap applies to the departure-time average. Example. Consider a G/D/1 system such that: Service time = 1 deterministically. Inter-arrival time always > // Not exponentially distributed Every arriving customer sees an empty system and every departing customer leaves an empty system behind. Thus, the population seen by an arriving or departing customer is 0 deterministically. Hence a0 = 1 = d0. However, P0 < 1.
14
Poisson arrival sees time average
Proposition If the arrival process is Poisson, then an = Pn for n 0 Proof. N(t) is determined by arrivals and departures during (0, t). The Poisson assumption implies independent arrivals over the two disjoint intervals (0, t) and (t, t+h). Departures in (0, t) are naturally irrelevant to arrivals in the future interval (t, t+h). Thus N(t) is independent of arrivals in (t, t+h). Thus, and an = // This is the explicit meaning of arrival-time average. = = Pn Prof. Bob Li
15
Poisson departure sees time average?
Symmetrically the handicap of the departure-time average would diminish when the departure process is Poisson. However, there is no natural way to create a Poisson departure process starting right at the time 0. Prof. Bob Li
16
B & D see the same. Proposition 8.1. In a birth-death queueing system, an = dn for all n 0. Proof. // When / < s and, in some cases, when / = s, the system converges. // When the system diverges, the Proposition still stands because all an = dn = 0 So, we assume the system converges and reaches stability in the long run. In a B-D system, there is one B at a time and one D at a time. The number of population transitions from n+1 to n during an interval [0, T], for any T, can differ from the number of transitions from n to n+1 by at most 1. When T , Number of population transitions from n to n+1 = Arrival count in (0, T) [an + o(T)] = T an + o(T) Number of population transitions from n+1 to n = Departure count in (0, T) [dn + o(T)] = T dn + o(T) Therefore, 1 =
17
B & D see the same. The B-D assumption in the above proposition is essential, as evidenced by the following Counterexample. Suppose that the unique transportation between the airport and a distant tourist attraction is a single shuttle bus. Tourists arrive at the attraction gate by bus (The whole bus load is regarded as arriving at the same time. Thus the queueing system is not B-D.) Arriving tourists then queue up in front of the ticket window (single server) and then enter the attraction site one by one. The queue will surely be emptied long before the bus makes another round trip to and from the distant airport. Thus a0 = 1. However, some departing customers do leave others behind. Hence d0 < 1. Corollary. In a stationary B-D queue with Poisson arrival, Pn = an = dn for n 0
18
B-D Queue Treat a B-D queue as a continuous-time markov chain. Limiting probabilities Pj abide with the law of flow balance: Through telescoping, for all n 0. If , then and the process will eventually Become stationary with the limiting probabilities If , then P0 = 0 and hence Pn = 0 for all n < . That is, as a continuous-time markov chain, the queue is unstable. Prof. Bob Li
19
6.3 M/M/s queueing system, 1 ≤ s ≤ ∞
Prof. Bob Li
20
M/M/1 queue In an M/M/1, for all n. Write = / = the offered load
The result on a general B-D process is the reduced to for all n 0. The queue is stable if and only if or, equivalently, < 1. When > 1, the queue length grows indefinitely longer and longer. When = 1, then Pn = 0 for all n // True for a B-D process in general. This M/M/1 queue = The symmetric 1-dim random walk with a barrier at 0. // Fold the symmetric 1-dim random walk at the point ½ so that // every state k, k > 0, coincide with the state k1 for all. Some consequences are: 1) The empty state will always be renewed, but the average renewal time is . 2) The population will keep achieving new all-time highs.
21
Stable M/M/1 queue ( < 1)
From the equation for all n 0, we find = n(1) for all n 0 That is, the limiting probabilities Pn are Geometric0(1) distributed. // Actually this has been derived in Chapter 5 before. From this distribution, we derive: The fraction of time 1P0 that the single server is working is called the utilization. In this case, the utilization 1P0 = = the offered load. The average population is L = // Mean of Geometric0(1) From L we can calculate W, WQ, and LQ .
22
Distribution of M/M/1 delay
We now calculate the distribution of the delay for an average customer in M/M/1. The distribution refers to data sampling over all departing customers in all time. It is the same as the delay of a customer in the steady state. Proposition. The delay of a customer in a stationary M/M/1 queue is Exponential() distributed. Proof. Let an arriving customer in the stationary M/M/1 sees X customers in the system. Since Poisson arrival sees time average, X is Geometric0(1) distributed, same as the limiting probabilities Pn of the M/M/1. Let the r.v. W* represent the delay of a customer in a stationary M/M/1 queue, which is the sum of X+1 service times. // We have being using the capital letter W for the average waiting time of a customer. // However, we normally use capital letters for r.v. So, we need here a “super-capital” // notation for the r.v. representing the delay in the stationary state. Note that EW* = W. As X+1 is Geometric1(1) distributed, W* is Exponential((1)) distributed. // See the Waiting for Godot problem on the next slide.
23
x buses have passed and the waiting time for the next bus > y
Waiting for Godot Problem. Buses arrive according to a Poisson process with the intensity , and it takes X buses to wait for Godot, and X is Geometric1(1) distributed. What is distribution of the arrival time W* of Godot. Proof. Thus W* is a sum of memorylessly many memoryless i.i.d. Claim that W* is a memoryless r.v., that is, under the condition of W* > w, the residual waiting time for Godot has the same distribution as the unconditional W* itself. In fact, under the stronger condition (more specification) that x buses have passed and the waiting time for the next bus > y the residual waiting time still has the distribution of the unconditional W*, which is therefore exponentially. // The sum of Geometric0(1) many exponential r.v. incurs a pointed prob. mass at 0. The rate of this exponential distribution is the reciprocal of the mean, which is W = E[W*] = (EX+1)/ = 1/(1) = 1/() In conclusion, the arrival time W* of Godot is Exponential() distributed.
24
Distribution of M/M/1 delay
Alternative proof by calculation. Under the condition of seeing n in the system upon arrival, the residual service time has the same distribution as a complete memoryless service time. Thus the conditional r.v. (W* | Seeing n in the system upon arrival) is Gamma(n+1, ) distributed. P{W* a} = n0 P{n in the system upon arrival}P{W* a | n in the system upon arrival} = n0 PnP{W* a | n in system upon arrival} // Poisson arrival sees time average. = n0 [Pn ] // W* is Gamma(n+1, ) density function = n0 [(1)n ] // Pn is Geometric0(1) distributed = n0 [ ] = …
25
Alternative proof (cont’d)
P{W* a} = … = n0 [ ] = () n0 [ ] = () // Interchanging order = () dt = 1 |x = a = 1 Prof. Bob Li
26
M/M/1/blocking queue with a finite capacity
Example. The buffer of a processor can hold at most only N1 jobs in the queue (plus another job being processed) // Here N is a deterministic integer. M/M/1 is a birth-death Markov process regardless of the queueing discipline. Again, time reversibility leads to for 0 n N. For the M/M/1/blocking queue, N // This formula stands regardless of how large is, // because the queueing discipline of blocking sets an // upper bound on the population and thereby // precludes divergence. In other words, regardless of // the traffic load, the fraction of arrivals that actually // enter the system makes a load below 1.
27
M/M/1/blocking queue with a finite capacity
Example. The buffer of a processor can hold at most only N1 jobs in the queue (plus another job being processed). // Here N is a deterministic integer. The average population L is:
28
M/M/1/blocking queue with a finite capacity
Example. The buffer of a processor can hold at most only N1 jobs in the queue (plus another job being processed) // Here N is a deterministic integer. From the formula for L, we can also derive the formula for W, the average delay of a customer by Little’s Formula W = L/. Note that the arrival rate includes blocked customers and hence this average W counts blocked arrivals as customers with zero delay. The fraction of arrivals that actually enter the system is 1PN. If the delay is averaged only among the entering customers, then the actual arrival rate is a = (1PN) and hence the average delay is Wa = L/a = L/[(1PN)]. // As N , 0 and thereby a and WaW Prof. Bob Li
29
M/M/s without buffering space (Erlang Loss System)
Example. At a parking lot with the capacity of s automobiles, arrivals at a full lot are immediately turned away. Example. An old telephone exchange is equipped with s digit receivers shared by all ports. Call arrivals are blocked when all digit receivers are busy. A stable B-D process is time-reversible. Its stationary probabilities abide with the simplified laws of flow balance: Pn1 = n Pn for 0 < n s. Or, equivalently, Pn = Pn1 / n = Pn1 / n for 0 < n s Prof. Bob Li
30
M/M/s without buffering space (Erlang Loss System)
Prof. Bob Li
31
M/M/s queue with infinite buffering capacity
. . . Laws of flow balance are: Pi = Pi1 / i = Pi1 / i for 0 < i < s and Pi = Pi1 / s = Pi1 / s for i s s
32
M/M/1 queue with bulk service
An exemplifying problem. A two-seat cable car serves two customers simultaneously when there are two or more customers present in the queue. When the system is empty, the cable car waits for the next arriving customer. The service time is Exponential() whether one or two customers are served. Model as a continuous-time markov chain. In order to calculate the limiting probabilities, we treat this queueing system as a continuous-time markov chain where the “state” is labeled by the queue length rather than the population. There are two different states corresponding to an empty queue: State 0 the queue is empty but the server is busy State 0 the whole system is empty Prof. Bob Li
33
M/M/1 queue with bulk service
The straightforward form of flow balance in the stationary state follows the red cuts. Taking advantage of the fact that all states in this transition diagram almost line up in a row, there is the better alternative of blue cuts that intersect with fewer transition arrows // similar to time reversible M C vs. Either one consists of homogeneous difference equations. // Discrete counterpart to homogeneous differential eq. It is clear that , and we shall try a solution in the form of // Discrete counterpart to trying f(x) = kex
34
M/M/1 queue with bulk service
It is clear that , and we shall try a solution in the form of vs. The only feasible root is The geometric form of the solution shows that: The system is stable < 1 < 2 < 2 // 2 is the maximum service rate. Hence must be strictly less than 2.
35
M/M/1 queue with bulk service
The boundary condition translates into In the stable case, Homework. What can you say about a 3-seat cable car? Prof. Bob Li
36
M/M/1 queue with bulk service
The average number of customers in the queue is // This is similar to the mean of a geometric distribution.
37
Network of queues Prof. Bob Li
38
Tandem of an M/M/1 queue and a ~/M/1 queue
(“~” refers to whatever is output by the M/M/1 queue.) To consider the stationary situation, we assume that < 1 and < 2. Since Queue 1 is M/M/1 and < 1, its stationary population is Geometric0(1/1) distributed. That is, Moreover, the stationary output from Queue 1 is a Poisson process at the intensity by Burke’s Theorem // Burke’s Thm applies more generally to M/M/s with < s. Thus, when Queue 1 reaches equilibrium, Queue 2 becomes another M/M/1. Since < 2. Queue 2 later also reach a stationary Geometric0(1/2) distributed population. Prof. Bob Li
39
Tandem of an M/M/1 queue plus a ~/M/1 queue
The following argument proves independence between the populations of the two individual queues in the stationary state and, in particular, in the stationary state. Population of Queue 1 is independent of the future arrival times. By time reversibility of a B-D process, the stationary population is also independent of the future arrival times in the reversed process, which are the past departure times in the forward process. In short, the stationary population of Queue 1 is independent of its past departure times. On the other hand, the past departure times are the only thing from Queue 1 that affects the status of Queue 2 at any moment. Prof. Bob Li
40
Tandem of an M/M/1 queue plus a ~/M/1 queue
Therefore the joint limiting probabilities are simply: Average population in the tandem network is From Little’s Formula, // Average delay in going through the whole tandem Prof. Bob Li
41
Alternative derivation without using time reversibility
A markov chain with states (i, j), where i, j 0: Laws of flow balance are: These are 2-variable homogeneous difference equations. So, we try a solution in the form of Luckily, it works with Normalization of probability then gives K = (1)(1) Prof. Bob Li
42
skipRemarks on stationary state
Let the random variables N* and M* represent the stationary populations in the two queues seen by customers upon entering the respective queues. Since Poisson arrival sees time average, N* and M* also represent the time averages, which are independent of each other from the above calculation. On the other hand, the two stationary populations N* and M that a particular customer sees upon entering the respective queues are not independent in general. Example. When is small in comparison with 2, P{M* > 0} = /2 is also small. Assume also that 1 = 2. There is a correlation between the two stationary populations that a particular customer sees upon entering the respective queues, because P{A customer sees M > 0 | The same customer saw nonempty Queue 1 upon entering Queue 1} ½
43
skipRemarks on stationary state (cont’d)
(3) The stationary delay in Queue 1 is Exponential(1). Remarkably enough, M is independent of this stationary delay and hence the delay times that a customer incurs at the two queues are independent. It is an open problem to find a simple explanation for this fact. N* M Service time in Q1 Waiting time in Q1 Independent! The positive and negative correlations cancel out. Any simple explanation? Positive correlation Independent Negative correlation Dependent Almost proportional Delay in Q1
44
General (open) system of queues
There are K nodes in the network. Each node j consists of sj exponential servers, each at the rate j. Customers arrive from outside the system to each node j in accordance with an independent Poisson process at the rate rj. Once a customer is served by a server at node i, he joins the queue of node j with probability Pij and departs from the system with the probability We are interested in the stationary probability P(n1, …, nK) = P(There are nj customers at each node j)
45
General (open) system of queues
Let j denote the stationary output “rate” of node j. // Our language: rate = memoryless rate; while “rate” = any average per unit time The stationary probability P(n1, …, nK) must abide with Law of Flow Balance: j is equal to the total “rate” of customer arrivals at node j from both inside and outside of the stationary system. That is, Prof. Bob Li
46
General (open) system of queues
Jackson’s Theorem. Assume that for j = 1, 2, …, K. Then, where Pj(nj) is the limiting probability of an M/M/sj queueing system with the arrival rate j and the service rate j for each server. // It is as if there were an independent M/M/sj queue at each node j. Proof. The solution magically abides with all the laws of flow balance. Open problem. Find a non-calculative explanation of Jackson’s Theorem. Prof. Bob Li
47
The case with a single server at every node
The total arrival process to a node j is not Poisson initially and not clear even in equilibrium. However, the stationary population at each node j has an independent geometric distribution, which is the same as an M/M/1 queue with the arrival intensity j. The joint distribution P(n1, …, nK) is the same as the joint distribution of K independent M/M/1 queues. The average time a customer spends in the network is, by applying Little’s Formula to the whole network,
48
Exemplifying network of two single-server queues
Poisson(4) external input 1 = 8 2 = 10 Poisson(5) external input Following previous notation, Prof. Bob Li
49
Two single-server queues in a feedback loop
Poisson() external input q 1 2 Following previous notation, Prof. Bob Li
50
skipDirect derivation of the formula for Pm,n
// instead of using Jackson’s Theorem p Poisson() external input q 1 2 The possible transitions: Current Next Average “rate” state state of transition (m, n) (m+1, n) Arrival of new customer (m, n) (m+1, n1) 2 Feedback to Server 1 (m, n) (m1, n) q1 Departures of customer (m, n) (m1, n+1) p1 Feedback to Server 2 Corresponding laws of flow balance: Solve for Pm,n.
51
Closed system of single-server queues
There are k single-server nodes. A fixed group of m customers move around these nodes. No customers enter into or exit from the network. A customer, upon completion of service by server i, goes to the single-server j with the probability Pij. // The stochastic location of every individual customer forms a discrete-time markov chain with the transition probabilities Pij. We assume that this markov chain is irreducible. // Otherwise we would break it down into irreducible blocks Thus the stationary state {i}1ik is the unique positive solution of Prof. Bob Li
52
Closed system of single-server queues
The average arrival “rate” (j) at the server j is proportional to j. In fact, j is the normalized (j). That is, , where is the average service completion “rate” of the entire network. // Often is regarded as the system throughput. From the flow conservation , we can then calculate (j) or j. Hereafter we use a subscript m to emphasize the fixed population m. Thus, we write (j) as m(j) and so on. Prof. Bob Li
53
Jackson’s Theorem for a closed system
Jackson’s Theorem (for a closed system). The limiting probabilities of joint populations is when (8.22) // A product of geometric probabilities with the normalization constant // The computation of Cm by this formula requires the // summation over terms, a huge quantity. Proof. Verify this solution against laws of flow balance. Again, no intuitive explanation is known so far. Prof. Bob Li
54
Example of multiprogramming system
There are m different computer programs, each getting processed at the CPU first. Before returning to the CPU, there is the probability q = 1p that the program first goes through the I/O processor. Following the notation as before, we shall analyze the stationary state of this system.
55
Step 2. By Jackson’s theorem,
Step 1. The ratio among limiting probabilities 1 and 2 of the discrete-time markov chain. Clearly, 1 : 2 = 1 : q. That is, 2 = q1. Step 2. By Jackson’s theorem, Write = 2/q1 = (1/1)/(2/2). Thus, and hence Prof. Bob Li
56
The proportion renders the stationary state of the network no different from that of a simple 2-queue cycle with service rates q1 and 2. 2 q1 // Think of a CPU job in the original network as “successful” // with probability q. Every job is repeated until success. // The CPU in the new network only output successful jobs. // So, the service rate gets discounted by a factor q.
57
Thus // When < 1, bottleneck is at the I/O.
2 q1 Thus // When < 1, bottleneck is at the I/O. // When > 1, bottleneck is at the CPU. An appropriate measure of the throughput in the original network is at the point labeled “new program.” It is the throughput of the new CPU times p/q, which is busy for the proportion 1Pm(0, m) of time. Thus, the throughput is The average processing time of a “new program” in the original network is now simply the average processing time of a program. // Little’s Formula
58
The Arrival Theorem Proposition 8.3 (The Arrival Theorem). In the closed network system with m customers, the stationary population distribution of the system as seen by arrivals to server j is the time-average distribution in the same network system when there are only m1 customers. Intuition. From Jackson’s theorem, arrivals to the stationary closed network look like Poisson. On the other hand, Poisson arrival sees time average. A customer arriving at a node always sees a total of m1 other customers in the network. Proof. For (n1, n2, … , nk) with , we calculate the following posteriori probability as in Bayes rule: skip Prof. Bob Li
59
The Arrival Theorem (cont’d)
60
Breaking a closed loop Consider a closed cycle of three single-server queues with exponential service times. Assume that < 1, < 2, and m . From the Arrival Theorem, the system as seen by arrivals to the queue of service rate 2 is distributed as the stationary distribution in the same network system when there are m1 customers. The queue of the service rate is the slowest. With m , this queue is almost never empty in the stationary state. We can approximate this queue as the outside world that feeds traffic approximately at the rate into the open system of two queues in tandem at service rates 1 and 2. From the previous analysis of such a tandem, roughly the populations at the two queues are independently geometric.
61
Mean value analysis of the closed system
Notation. m = Population in a closed network of queues m(j) = Average arrival “rate” at server j // The “system throughput” {j} = Stationary state of the imbedded discrete-time markov chain Wm(j) = Average delay a customer spends at server j when he visits server j Lm(j) = Average number of customers at server j // Little’s Formula (8.26) We have a recursive way for computing Lm(j) and Wm(j) as follows: Prof. Bob Li
62
Mean value analysis of the closed system
Lm(j) Wm(j) Lm1(j) Wm1(j) // The Arrival Theorem; Mean of sum is sum of means. Wmj) = Wm1(j) = This gives the recursive formula On the other hand, the boundary condition gives
63
Mean value analysis of the closed system
Hence and (8.28) Substituting (8.28) into the recursive formula of Wm(j), (8.29) Prof. Bob Li
64
Mean value analysis of the closed system
Paraphrasing of recursive calculation: Initialization. Calculate {j} from [Pij]ij of the discrete-time markov chain. for all j. (8.28) (8.26) Wm1(j) m Lm1(j) (8.29) (8.28) (8.26) Wm(j) m Lm(j) (8.29) Prof. Bob Li
65
Example of k cyclic queues
By symmetry, j = 1/k for all j. Start with From (8.29), From (8.28), From (8.26), k Prof. Bob Li
66
A closed network of a time-sharing system
The computer is a single server for a fixed number of N jobs. When a job ready for processing, it enters the FIFO queue (point B). After processing, the job goes to its designated terminal for a period of reflection time before it is ready for processing again. N = Number of jobs = number of terminals P = Average job processing time at computer R = Average of (exponential) reflection time at terminal T = Average total time of a job from point A to point C = The throughput = Arrival “rate” at point A First we want to estimate the throughput .
67
A closed network of a time-sharing system
From Little’s Formula, T = N. Since N is fixed, is inversely proportional to T. In the swiftest case, a job receives immediate service after the reflection. Thus, T ≥ R + P. At the other extreme, a job is the Nth to be processed. Thus, T = R ≤ NP. Combining these together, Another upper bound of can be derived: P = Average job processing time per unit time = Stationary probability that computer is busy 1 In conclusion, the throughput is bounded by
68
A closed network of a time-sharing system
In conclusion, the throughput is bounded by If , the limit of the throughput is 1/P by the processing power. If , the limit is N/(R+P) because of insufficient users.
69
A closed network of a time-sharing system
If , the limit of the throughput is by the processing power. If , the limit N/(R+P) of the throughput is because of insufficient users.
70
A closed network of a time-sharing system
Next we are to find the limiting population of the queue at the computer. After a job is processed, it goes to a terminal and the reflection time begins immediately. Treating the reflection time as another kind of service time, the N terminals can then be replaced by an M/M/. // Actually an M/M/s with s N suffices. The previously stated Jackson’s theorem for a closed system has been for networks of M/M/1’s, and we have not extended the theorem to allow M/M/. Nevertheless, the network can be dealt with as a continuous-time markov chain, where a state is a pair (k, Nk) of populations at the M/M/ and the M/M/1. The stationary probability of this state is denoted as P(k, Nk). The diagram of transition rates is given below.
71
A closed network of a time-sharing system
(0, N) (1, N1) (2, N2) … (N1, 1) (N, 0) 1/P N/R (N1)/R 3/R 2/R 1/R From the laws of flow balance, P(n, Nn) = P(n1, Nn+1) R/nP Telescoping, P(n, Nn) ~ After normalization, P(n, Nn) , where Utilization of the CPU is Examining the M/M/1, we find the throughput (output rate of the M/M/1 in this case) to be
72
A closed network of a time-sharing system
This throughput is shown by the bold line in the following figure.
73
Lecture 11 April 10, 2013 Prof. Bob Li
74
M/G/1 queueing system Prof. Bob Li
75
A lemma for a general system
// Such as G/G/s with possibly some blocking The main goal of this section is to calculate WQ. Convention for a general system. = time-average of entering customers per unit time // = arrival “rate” when there is no blocking // = arrival rate in the special case of M/G/s WQ* = an r.v. representing the waiting time of an entering customer S = an r.v. representing a service time For a customer being served, the “remaining service time at time t” measures the part of his service time after the time point t. When a customer is in queue at time t, the “remaining service time at time t” is whatever duration his service time will turn out to be. Prof. Bob Li
76
A lemma for a general system
Lemma 1. Let each customer in the system at any time pay money to the system at the rate equal to his remaining service time. Then, . Average earning rate of the system // Time average = E[Total payment by a customer] // Average over customers = E[SWQ*] +E[S2]/ // Sum of averages of r.v. // Remaining service time is unknown until departure. Payment has to be retroactive. Proof. Whole amount paid by a customer when in queue = SWQ* // S and WQ* are r.v. Whole amount paid by a customer during his service = S2/2 // t = age of service Arrival time Service begins. Departure time S WQ*
77
A lemma for a general system
Proof. … Following the same kind of argument in Little’s Formulas 1 and 2, Time average of earning rate from all customers in queue = E[Amount paid by a customer when he is in queue] = E[SWQ*] (8.30a) Time average of earning rate from all customers during their services = E[Amount paid by a customer during his service] = E[S2/2] (8.30b) Time average of earning rate of the system // Time average = E[Total payment by a customer] // Average over customers = E[S WQ* + S2/2] // Average of an r.v. = E[S WQ*] + E[S2]/ (8.30) Prof. Bob Li
78
Lemma 2: Poisson arrival sees time average
Lemma 2. Consider a general queueing system with Poisson arrivals. Let each customer at any time pay money to the system at the rate equal to his remaining service time. Then, arrival-time average of the system earning rate is equal to time average. Proof. Let X(t) denote the cumulative system earning during the interval (0, t). Time average of system earning rate = On the other hand, Arrival-time average of system earning rate = … Prof. Bob Li
79
Lemma 2: Poisson arrival sees time average
= = Time average of system earning rate // System earning during (0, t) is completely determined by: // (a) arrival times during (0, t) and // (b) departure times of those customers that arrive during (0, t). // (a) is irrelevant to arrivals in (t, t+h) because: // Poisson input independent arrivals over disjoint intervals // (b) is irrelevant to arrivals in (t, t+h) because FIFO service // System earning rate at t is independent of arrivals in (t, t+h) Prof. Bob Li
80
Pollaczek-Khinchin (P-K) formula
Theorem (P-K Formula). WQ = E[S2] / 2(1ES) for an M/G/1, where is the arrival rate and S is the r.v. representing a service time. // From WQ, we can derive W, LQ and L as usual. Proof. We shall derive a linear equation for WQ: WQ = ES WQ + E[S2]/2 // The derivation utilizes 3 properties of the M/G/1 queue: A single server Poisson arrival Independence between the service time S and the waiting time WQ* of a customer WQ // = E[WQ*] = Departure-time average of waiting time // Average over all customers in the long run = Arrival-time average of waiting time // Because of B-D = Arrival-time average of (sum of remaining service times of those customers seen by the arriving customer) // Because of the single server = Arrival-time average of system earning rate = Time average of system earning rate // Lemma 2: Poisson arrival sees time average.
81
Pollaczek-Khinchin (P-K) formula
Theorem (P-K Formula). WQ = E[S2] / 2(1ES) for an M/G/1, where is the arrival rate and S is the r.v. representing a service time. // From WQ, we can derive W, LQ and L as usual. Proof. WQ = … = Time average of system earning rate = E[Total payment by a customer] // By Lemma 1 // E[Total …] is an average over all customers. = E[S WQ*] + E[S2/2] // averages of r.v., also by Lemma 1 = ES E[WQ*] + E[S2]/ // S is independent of WQ* = ES WQ + E[S2]/2 We arrive at the equation WQ = ES WQ + E[S2]/2 Therefore, WQ = E[S2] / 2(1ES) Prof. Bob Li
82
Paraphrasing of proof || B-D
Time averages Averages of r.v. Departure/arrival-time averages WQ ==== Dep-time ave. of queueing || B-D Arr-time ave. of queueing || Single server Arr-time ave. of (remaining) || Time ave. of earning rate ======= Arr-time ave. of earning rate Lemma 1 Lemma 2: Poisson arrival sees time ave. =========== E[Total payment of a customer] || Also by Lemma 1 E[SWQ*] + E[S2]/2 || Indep. between S and WQ* ESWQ + E[S2]/2 Prof. Bob Li
83
G/M/1 queueing system Prof. Bob Li
84
Arrival-time markov chain of G/M/1
The arrival is not memoryless, so the number of customers in the system is not informative enough to serve as the “state.” The missing information is the age of the last arrival. To circumvent this deficiency, we shall examine the markov chain at just the arrival times. Denote Xn = the number of people seen by the n-th arrival This defines the (discrete) arrival-time markov chain {Xn}n1. From a state Xn = i, a transition is to Xn+1 = i+1–Y, where Y is the number of service completions during the inter-arrival time. Under the condition of an inter-arrival time t, the distribution of Y is Poisson(t) but truncated by the upper bound i+1, which is the population right after the n-th arrival // Remaining probability goes to i+1. Write G for the distribution function of an inter-arrival time. The said transition probability is: Pi,i+1y = , 0 y i // And remaining probability goes to y = i+1. or Pi,k = , 1 k i+1 // Remaining probability goes to Pi,0.
85
Stationary state of the arrival-time markov chain
The stationary state {i}0i< of the arrival-time markov chain abides with or (8.48) with the normalization of j j = 1. To solve the integral equations (8.48), try a solution in the form of a geometric distribution: k = (1 ) k // This is not a wild guess; explained in Ross book. is the // proportion of customers that see at least 1 upon arrivals. Equations (8.48) become // May solve numerically. For M/M/1, = is a solution.
86
Delay and waiting time analysis
Let the r.v. W* represent the delay of a customer in the stationary state. If this customer sees Y upon arrival, then W* is the sum of Y+1 Exponential() i.i.d. Since Y+1 is Geometric1(1) distributed, W* is exponential with the mean W // Waiting for Godot Hence WQ = W 1/ Let the r.v. WQ* represent the waiting of a customer in the stationary state. Then, P{WQ* = 0} = P{Sees 0 upon arrival} = 0 = 1. // Pointed prob. mass The conditional r.v. (WQ* | Sees at least 1 upon arrival) has the same distribution as W*. Denote the mean inter-arrival time by 1/. Then, L = W and LQ = WQ Prof. Bob Li
87
Time average of population
For a stationary G/G/1 system, The “rate” at which the population changes from k1 to k = (Arrival “rate” ) (Proportion k1of arrivals that see k1 in the system) // Similar argument to Little’s Formulas The “rate” at which the population changes from k to k1 = (Time average Pk of the probability of a population k) (service “rate” ) Since a G/G/1 queue is a B-D process, the above two “rates” of changes must be equal. Thus k1 = Pk. Therefore, Pk = (/)k1 for k > 1 and P0 = 1 / Prof. Bob Li
88
G/M/1 time average of population
For a stationary G/G/1 system, The “rate” at which the population changes from k1 to k = (Arrival “rate” ) (Proportion k1of arrivals that see k1 in the system) // Similar argument to Little’s Formulas The “rate” at which the population changes from k to k1 = (Time average Pk of the probability of a population k) (service “rate” ) Since a G/G/1 queue is a B-D process, the above two “rates” of changes must be equal. Thus k1 = Pk. Therefore, Pk = (/)k1 for k > 1 and P0 = 1 / For a stationary G/M/1 system in particular, we have calculated k = P{arrival sees k in the system} = (1) k // where is the solution to Hence Pk = (/)(1) k1 for k > 1
89
Busy and idle periods Prof. Bob Li
90
Average length of a busy period
A general queueing system, such as G/G/s, the population at an arrival time is not informative enough to describe the system. Is there any simplified markov chain naturally imbedded inside? One way is to classify the population as just empty and nonempty. Let the system starts empty. The system alternates between idle periods and busy periods. Whenever the system becomes idle, the initial state is renewed. A renewal interval consists of an idle period followed by a busy period. A renewal time is measured from one renewal to the next. The renewal times are i.i.d. Lengths of the idle periods I1, I2, … are also i.i.d., since each of them is the waiting time from a renewal till the next arrival. Consequently, lengths of the busy periods B1, B2, … are also i.i.d. Prof. Bob Li
91
Average length of a busy period
Recall the notation P0 = P{Stationary system is idle}. // An average over time By the strong law of large numbers, with probability 1 where the r.v. I and B, respectively, represent the duration of an idle period and a busy period in the steady state. This establishes an equation for a general queue: P (8.35)
92
Average length of G/G/1 busy period
For a G/G/1 queue, P0 can be calculated by: 1 P0 = P{A single customer is being served.} = E[Number of customers being served] // Mean of a 0/1 r.v. = 1/ // Little’s Formula on no. of customers being served Thus, P0 = 1/ = 1 (8.37) // = the arrival “rate” and 1/ = the mean service time (8.35) and (8.37) together give 1 (8.35a) To calculate EB and EI, we need a second equation. Prof. Bob Li
93
Var((X1 + X2 + ... + Xn)/n) = 2/n 0 as n .
Law of Large Numbers Strong Law of Large Numbers. Let X1, X2, ... , Xn be i.i.d. with EX1 = m. If Var(X1) < , then Remark. Let be the sample space of X1. The Strong Law involves the sample space It is not hard to define a probability measure on this infinite product space. A sample in it is a random sequence (x1, x2, ... , xn, ...). The Strong Law says that, with the probability 1, the time-average of a randomly selected sample converges to m in the long run (i.e., as n). This is not surprising since Var((X1 + X Xn)/n) = 2/n 0 as n . A concise rephrasing is: time-average almost surely converges to mean. Prof. Bob Li
94
Proof of Strong Law of Large Numbers
Proof. An r.v. Y is almost surely equal to a constant m iff E[(Y m)2] = 0. Taking Y to be in particular , we need to show that Write Yn = Xn m. Then Y1, Y2, ... , Yn are i.i.d. with zero mean.
95
Average length of M/G/1 busy period
Theorem for a steady M/G/1 queue. Proof. In the case when arrival is memoryless, (8.36) // When arrival is not memoryless the idle time I is only part of an inter-arrival time. (8.36), together with (8.35a) proves the theorem. Corollary. In a steady M/G/1 queue, the average number of services in a busy period is Proof. Let the r.v. C represent the number of services in a busy period. Then, EB = EC·1/. Thus, EC = EB Prof. Bob Li
96
Busy and idle periods For the G/G/1 queue, we have (8.35a)
Other than an M/G/1 queue, it requires one more equation to determine EB and EI. // When arrival is not memoryless the idle time I is only part of an inter-arrival time. Below we shall derive the extra equation for G/M/1. Prof. Bob Li
97
Busy and idle periods A busy period followed by an idle period
Time Renew N=3 service times in B I N=5 service times in B I T T T3 A busy period followed by an idle period = A renewal interval = The accumulation of N consecutive interarrival times T1, T2, … , TN, where the r.v. N represents the number of services in the busy period. EB + EI = E[Length of a renewal interval] = E[T1 + T2 + … + TN] = EN ET // N is a stopping time of the process T1, T2, …, because TN is // the first arrival in the busy period that sees an empty system. = EN/
98
Busy and idle periods On the other hand, 1/EN
Time Renew N=3 service times in B I N=5 service times in B I T T T3 On the other hand, 1/EN = The proportion of arrivals that are renewals = 1 for a G/M/1 queue // where is a solution of This is the extra relation we need. In conclusion, for a G/M/1 system, EB = and EI = Prof. Bob Li
99
M/G/1 busy period distribution
To determine the distribution of a busy period of an M/G/1, we shall deal with the Laplace transform of this distribution. Let the r.v. S stands for a service time Theorem. Write Then, B() satisfies the equation Proof. A busy period is started by the arrival of a customer during an idle period. Starting with the service time of this customer, all service times in the busy period are organized into a family tree: When customer arrives during the busy period, the service time of this customer is regarded as a “son” of the ongoing service time. Since permutation of customers in the queue does not affect the busy period, we may let customers be served in the “depth-first” order of the family tree. Let the r.v. A represent the number of arrivals during the service of a customer. Thus a service time has A sons, which engender A busy periods represented by the i.i.d. B1, B2, …. BA.
100
M/G/1 busy period distribution
Proof. … Thus a service time has A sons, which engender A busy periods represented by the i.i.d. B1, B2, …, BA. The busy period consists of the initial service time and these A busy periods. That is, B = S + B1 + B2 + … + BA We shall first calculate , then , and finally // The Laplace transform of B.
101
M/G/1 busy period distribution
Exercise. Solve the equation for MM/1.
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.