Queuing Networks
1
- Outline of queuing networks
- Mean Value Analisys (MVA) for open and closed
Queuing Networks - Outline of queuing networks - Mean Value Analisys - - PowerPoint PPT Presentation
Queuing Networks - Outline of queuing networks - Mean Value Analisys (MVA) for open and closed queuing networks 1 Open queuing networks outgoing requests incoming requests DISK CPU CD Closed queuing networks (finite number of users)
1
2
DISK CD
requests incoming requests
CPU DISK CD CPU M clients
(finite number of users)
3
S(n) R(n) S(n) R(n) S(n) R(n) n n n
K: number of queues X0: network average throughput. If open network in a stationary condition X0 = Vi: average number of visits a generic request makes to i server from its generation to its service time (request goes out from the system if open network) Si: average request service time at the server i Wi: average request waiting time in the queue i Ri: average request response time in the queue i Ri = Si + Wi
4
Xi: throughput for the i-th queue Xi = X0 Vi R’
i: average request residence time in the queue i from its creation to
its service completion time (request goes out from the system if
R’
i = Vi Ri
Di: request service demand to a server in a queue i from its creation to its service completion time (request goes out from the system if
Di = Vi Si
5
Qi: total time a request spends waiting in the queue i from its creation to its service time (request goes out from the system if open network) Qi = Vi Wi
i = Vi Ri =Vi (Wi + Si) = Wi Vi + Si Vi = Qi + Di
R0 = k
i=1 R’ i
ni: average number of requests waiting or in service at the queue i N: average number of requests in the system N = k
i=1 ni
6
7
DISK TAPE
requests incoming requests
CPU
Equations: Arrival theorem (for open networks): the average number of requests in a queue i that an incoming request find in the same queue (na
i), is equal to the average number of requests in the
queue i (ni). Ri(n) = Si + Wi(n) = Si + ni Si Using Little’s Law (ni = Xi Ri) and Ui = Xi Si : Ri = Si _
(1-Ui)
8
Equations: Then: R’
i = Vi Ri = Di _ (1-Ui)
besides: ni = Ui _
(1-Ui)
9
because ni = Xi Ri Ri = Si / (1- Ui ) Ui = Xi Si
Calculation of the greatest : In an open network the average frequency of users incoming into the network is
in the greatest value of that we can apply to the network. Given: Ui = Xi Si = Vi Si then:
= Ui / Di because Di = Vi Si
Ui = 1 is the greatest utilization factor of a queue (i.e.= i), then we can calculate the greatest that doesn’t make unstable the system as:
maxk i=1 Di
10
(example 9.1) =10.800 requests per hour = 3 requests per sec = X0 DCPU = 0,2 sec Service demand at CPU VDISK1 = 5 VDISK2 = 3 SDISK1 = SDISK2 = 15 msec DDISK1 = VDISK1 * SDISK1 = 5 * 15 msec = 75 msec Service demand at disk 1 DDISK2 = VDISK2 * SDISK2 = 3 * 15 msec = 45 msec Service demand at disk 2
11
CPU DISK1 DISK2
(example 1)
.
Service Demand Law UCPU = DCPU * X0 = 0,2 sec/req * 3 req/sec = 0,6 CPU utilization UD1 = DDISK1 * X0 = = 0,225 Disk1 utilization UD2 = = 0,135 Disk2 utilization Residence time R’CPU = DCPU / (1- UCPU ) = 0,5 sec R’D1 = DDISK1 / (1- UDISK1 ) = 0,097 sec R’D2 = DDISK2 / (1- UDISK2 ) = 0,052 sec
12
CPU DISK1 DISK2
Total response time R0 = R’CPU + R’D1 + R’D2 = 0,649 sec Average number of requests at each queue nCPU = UCPU / (1- UCPU ) = 0,6 / (1-0,6) = 1,5 nDISK1 = = 0,29 nDISK2 = = 0,16 Total number of requests at the server N = nCPU + nDISK2 + nDISK2 = 1,95 requests RMaximum arrival rate = 1 _ = 1 _ = 5 req /sec
maxk i=1 Di max (0,2; 0,075; 0,045)
13
14
DISK TAPE CPU M clients
(finite number of users)
throughput, average queue lenght, etc…) for a closed network
results can be calculated from the same network results with a population reduced by one unit.
Definitions . X0: average queuing network throughput. . Vi: average number of visits for a request at a queue i. . Si: average service time for a request on the server i. . Ri: average response time for a request at the queue i (service+waiting time)
15
Definitions . R’
i: total average stay time for a request at the queue i considering all its visits
at the queue. Equal to Vi Ri . Di: total average service time for a request at the queue i considering all its visits at the queue. Equal to Vi Si . R0: average response time of the queuing network. Equal to the sum of the R’
i
. ni
a: average number of the requests found by a request incoming in the
queue. Forced Flow Law Then we have: Xi = X0 Vi
16
Equations: Ri(n) = Si + Wi(n) = Si + ni
a(n) Si = Si (1+ ni a(n) )
Arrival Theorem: the average number of requests (ni
a) in a queue i that
an incoming request finds in the same queue is equal to the average number of requests in the queue i when n-1 requests are in the queuing network (ni
(n-1) that is n minus the incoming request that wants the
service on the i-th queue) in other words: ni
a(n) = ni (n-1) (i.e ni is function of n-1)
then: Ri = Si(1+ni(n-1)) and multiplying both members for Vi → R’
i = Di(1+ni(n-1))
17
Equations: Applying Little’s Law to the whole “queuing network” system (n=X0R0), we have: →
r=1 R’ i(n)
Applying Little’s Law and Forced Flow Law: → ni(n) = Xi(n) Ri(n) = X0(n) Vi Ri(n) = X0(n) R’
i(n)
18
19
Three equations: → Residence Time equation R’
i (n)= Di[1+ni(n-1)]
→ Throughput equation
r=1 R’ i(n)
→ Queue lenght equation
i(n)
Iterative procedure: 1. We know that ni(n) = 0 for n=0: if no users is in the queuing network, then no users (requests) will be in every single queue. 2. Given ni(0) it’s possible to evaluate all R’
i(1)
3. Given all R’
i(1) it’s possible to evaluate all ni(1) and X0(1)
4. Given all ni(1) it’s possible to evaluate all R’
i(2)
5. The procedure continues until all ni(n), R’
i(n) and X0(n) are found,
where n is the total number of users (requests) inside the network.
20
(example 9.3)
DCPU = SCPU = 15 msec
CPU service demand
DDISK = SDISK * VDISK = 9 * 5 = 45 msec Disk service demand
21
(example 2) Using MVA Equations n = 0; Number of concurrent requests R’CPU = 0; Residence time for CPU R’DISK = 0; Residence time for disk R0 = 0; Average response time X0 = 0; Throughput nCPU = 0; Queue lenght at CPU nDISK = 0 Queue lenght at disk n = 1; R’CPU = DCPU (1+ nCPU(0)) = DCPU = 15 msec; R’DISK = DDISK (1+ nDISK(0)) = DDISK = 45 msec; R0 = R’CPU + R’DISK = 60 msec; X0 = n/ R0 = 0,0167 tx/msec nCPU = X0 * R’CPU = 0,250 nDISK = X0 * R’DISK = 0,750
22
23
(example 2)
n = 1; R’CPU = DCPU (1+ nCPU(0)) = DCPU = 15 msec; R’DISK = DDISK (1+ nDISK(0)) = DDISK = 45 msec; R0 = R’CPU + R’DISK = 60 msec; X0 = 1 / R0 = 0,0167 tx/msec nCPU = X0 * R’CPU = 0,250 nDISK = 0,750 n = 2; R’CPU = DCPU (1 + nCPU(1)) = 15 * 1,25 = 18,75 msec; R’DISK = DDISK (1 + nDISK(1)) = 45 * 1,750 = 78,75 msec; R0 = R’CPU + R’DISK = 97,5 msec; X0 = 2 / R0 = 0,0205 tx/msec nCPU = X0 * R’CPU = 0,38 nDISK = X0 * R’DISK = 1,62
24
50/Z 1 2 49/Z 1/Z 49 50
X0(1) X0(2) X0(50)
Bottleneck identification (1/3) Usually the queuing network throughput will reach saturation if requests increase inside the system; we are then interested in finding the component in the system that causes saturation. → in open networks: 1 _
maxk i=1 Di
and replacing with X0 (n): X0 (n) 1 _ maxk
i=1 Di
25
Bottleneck identification (2/3)
R’i (n) = Di [1 + ni(n-1)] → R’
i Di for every queue i,
then we have (from Little’s formula): X0 (n) = n n _
K r=1 R’ i K r=1 Di
26
Bottleneck identification (3/3)
→ X0 (n) min n _ , 1 _
K r=1 Di maxk i=1 Di
For little n the throughput will increase at the most in a linear way with n, then becomes flat around the value 1/ maxk
i=1 Di
27
X0 n
Average response time (1/2) When throughput reaches its greatest value (that is for n big) the average response time is equivalent to: R0 (n) n _ max throughput Then for n big the response time increases in a linear way with n: → R0 (n) n maxk
i=1 Di
On the contrary, for small values of n (n near to 1) the average response time will be: → R0 (n) = K
r=1 Di
28
Average response time (2/2) We can establish a lower bound on average response time equal to: → R0 (n) max K
i=1 Di , n ∙ maxk i=1 Di
29
(Example 9.4) New scenarios with regard to previous example:
c. faster CPU (service demand = 7,5 msec)
Scenario Service demand DCPU Service demand DDISK Di 1/ maxDi Bottleneck a 15 2,5 * 9 = 22,5 37,5 0,044 disk b 15 5*5,63 = 28,15 43,15 0,036 disk c 15/2 = 7,5 45 52,5 0,022 disk a+b 15 2,5*5,63 = 14,08 29,08 0,067 CPU a+c 15/2 = 7,5 2,5 * 9 = 22,5 30,0 0,044 disk
30