Tipi di risorse in una rete di code

Download Report

Transcript Tipi di risorse in una rete di code

Components performance
modelling
- Outline of queue networks
- Mean Value Analisys (MVA) for open and close
queue networks
1
Open queue network
outgoing
requests
incoming
requests
DISK
CPU
TAPE
Closed queue network
(number finite of users)
DISK
M clients
CPU
TAPE
2
Kind of resources in a queue network
S(n)
R(n)
Load independent
n
S(n)
R(n)
Load dependent
n
S(n)
R(n)
Delay
n
3
Definitions
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 answer time in the queue i
Ri = Si + Wi
4
Definitions
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 time (request goes out from the system if open network)
R’i = Vi Ri
Di: request service demand to a server in a queue i from its creation to
its service time (request goes out from the system if open network)
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
------------------------------R’i = Vi Ri =Vi (Wi + Si) = Wi Vi + Si Vi = Qi + Di
------------------------------R0: average request answer time from the whole system
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
Open queue network
outgoing
requests
incoming
requests
DISK
CPU
TAPE
7
Open networks
(Single Class)
Equations:
Arrival theorem (for open networks): the average number of
requests in a queue i that an incoming request find in the same
queue (nai), 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)
Ri = Si (1 + ni) = Si + Si Xi Ri
Ri (1- Ui) = Si
8
Open networks
(Single Class)
Equations:
Then:
. R’ i = V i Ri =
Di _
(1-Ui)
Besides:
. ni =
Ui _
(1-Ui)
Because Ui = Xi Si
9
Open networks
(Single Class)
Calculation of the greatest  :
In an open network the average frequency of users incoming into the
network is fixed. For  too much big the network will become unstable,
we are then interested in the greatest value of  that we can apply to the
network.
Because:
Ui = Xi Si =  Vi Si
then:
 = Ui / Di because Di = Vi Si
Ui = 1 for the greatest use of the queue i, then we can calculate the
greatest  that doesn’t make unstable the system:

1
_
maxki=1 Di
10
DB Server
(example 1)
CPU
DISK1
DISK2
10.800 request per hour = 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
DDISK2 = VDISK2 * SDISK2 = 3 * 15 msec = 45 msec
Service demand at disk 1
Service demand at disk 2
11
DB Server
(example 1)
CPU
DISK1
DISK2
.
Service Demand Law
UCPU = DCPU * X0 = 0,2 sec/req * 3 req/sec = 0,6
UD1 = DDISK1 * X0 =
= 0,225
UD2 =
= 0,135
CPU utilization
Disk1 utilization
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
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)
nDISK1 =
nDISK2 =
= 1,5
= 0,29
= 0,16
Total number of requests at the server
N = nCPU + nDISK2 + nDISK2 = 1,95 requests
RMaximum arrival rate
=
1 _=
1
_ = 5 req /sec
maxki=1 Di
max (0,2; 0,075; 0,045)
13
Closed queue network
(number finite of users)
DISK
M clients
CPU
TAPE
14
Closed networks
(Mean Value Analysis)
• Allows calculating the performance indexes (average response time,
throughput, average queue lenght, etc…) for a closed network
• Iterative method based on the consideration that a queue network results
can be calculated from the same network results with a population reduced
by one unit.
• Useful also for hybrid queue networks
Definitions
. X0: average queue 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 stay time for a request at the queue i.
15
Closed networks
(Mean Value Analysis)
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 queue network. Equal to the sum of the R’i
. nia: average number of the requests found by a request incoming in the queue.
Forced Flow Law
Then we have:
. X i = X 0 Vi
16
Mean Value Analysis
(Single class)
Equations:
Ri(n) = Si + Wi(n) = Si + nia(n) Si = Si (1+ nia(n) )
Arrival Theorem: the average number of requests (nia) in a queue i that an
incoming request find in the same queue, is equal to the average number
of requests in the queue i if n-1 requests are in the queue network (ni (n-1)
that is n minus what wants the service on the i-th queue)
in other words:
nia(n) = ni (n-1)
then: Ri = Si(1+ni(n-1))
and multiplying both members for Vi
→
R’i = Di(1+ni(n-1))
17
Mean Value Analysis
(Single class)
Equations:
Applying Little’s Law to the whole “queue network” system (n=X0R0),
we have:
→
X0 = n / R0(n) = n / Kr=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
Mean Value Analysis
(Single class)
Three equations:
→ Residence Time equation
R’i = Di[1+ni(n-1)]
→ Throughput equation
X0 = n / Kr=1 R’i(n)
→ Queue lenght equation
ni(n) = X0(n) R’i(n)
19
Mean Value Analysis
(Single class)
Iterative procedure:
1.
We know that ni(n) = 0 for n=0: if no message is in the queue
network, then no message 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 number of requests inside the network.
20
DB Server
(example 2)
• Requests from 50 clients
• Every request needs 5 record read from (visit to) a disk
• Average read time for a record (visit) = 9 msec
• Every request to DB needs 15 msec CPU
DCPU = SCPU = 15 msec
CPU service demand
DDISK = SDISK * VDISK = 9 * 5 = 45 msec Disk service demand
21
DB Server
(example 2)
Using MVA Equations
n = 0;
R’CPU = 0;
R’DISK = 0;
R0 = 0;
X0 = 0;
nCPU = 0;
nDISK = 0
Number of concurrent requests
Residence time for CPU
Residence time for disk
Average response time
Throughput
Queue lenght at CPU
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 = 0,750
22
DB Server
(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,0333 tx/msec
nCPU = X0 * R’CPU = 0,625
nDISK = X0 * R’DISK = 2,625
23
Closed networks
(Single Class) - Bounds
Bottleneck identification (1/3)
Usually the queue 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
_
maxki=1 Di
and replacing  with X0 (n):
X0 (n) 
1
maxki=1
_
Di
24
Closed networks
(Single Class) - Bounds
Bottleneck identification (2/3)
 from throughput equation of MVA, remembering that
R’i (n) = Di [1 + ni(n)]
→
R’i  Di for every queue i,
then we have:
X0 (n) =
n
Kr=1 R’i

n
_
Kr=1 Di
25
Closed networks
(Single Class) - Bounds
Bottleneck identification (3/3)
 Combining the preceding two equations we obtain:
→ X0 (n)  min
n _,
1 _
Kr=1 Di maxki=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/ maxki=1 Di
X0
n
26
Closed networks
(Single Class) - Bounds
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 maxki=1 Di
On the contrary, for small values of n (n near to 1) the average response
time will be:
→ R0 (n) = Kr=1 Di
considering that all waiting times are null.
27
Closed networks
(Single Class) - Bounds
Average response time (2/2)
We can establish a lower bound on average response time equal to:
→ R0 (n)  max Ki=1 Di , n ∙ maxki=1 Di
28
DB Server
(Example 3)
New scenarios with regard to preceding example:
a. index variation in DB (# of disk access equal to 2,5 (before was 5))
b. 60% faster Disk (average service time = 5,63 msec)
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,55*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
29