Week 01 B
Week 01 B
COMP9334 1
Last lecture
• Solve capacity planning by solving a number of
performance analysis problems
• Performance metrics
• Response time, waiting time
• Throughput
T1,2024 COMP9334 2
This lecture
• Queueing networks
• Operational analysis
• Fundamental laws relating the basic performance metrics
T1,2024 COMP9334 3
Modelling computer systems
T1,2024 COMP9334 4
Pictorial representation of single server queues
Waiting line
server
Arriving
customers
Queue
Requests waiting
to be processed CPU Finished
Arriving
requests requests
T1,2024 COMP9334 5
Pictorial representation of queues
Waiting line
m
T1,2024 COMP9334 6
A simple database server
The server has a CPU and a disk.
Open queueing network
External arrivals
Workload intensity
A transaction specified
may visit the CPUby arrival
and rate times.
disk multiple
Unbounded
T1,2024 number of customers in the system
COMP9334 7
Database servers for batch jobs
• Example: Batch processing system
• E.g. For summarization data from databases
External arrivals
Database server for batch jobs
Workload intensity specified by arrival rate
Work in a closed
Unbounded number of customers in the system queueing network is
In equilibrium, flow in = flow out
called jobs
) throughput = arrival rate
Page 26
Service
Different techniques areLevel
neededAgreements
to analyse open and
closed Transaction
queueing networks
Maximum Average Minimum
T1,2024 Group COMP9334 Response Time (sec) Throughput 12
owed into the database. If the MPL is too MPL is already met, all remaining transactions are queued
will suffer, since not all DBMS resources up in an external queue. The application can then control
DB server – Multi-programming level
On the other hand, if the MPL is too high, the order in which transactions are executed by scheduling
ent control on scheduling. The question of the external queue.
e MPL to achieve both goals simultaneously
em, not•justSome database
for databases but inserver
system de-
Herein we management
study this problemsystems (DBMS)
in the context
workloads,set bothanviaupper
extensivelimit on the number
experimenta-
active transactions within the incoming
ng theoreticofanalysis. MPL=4
transactions external
he two most critical
system factors in adjusting the
queue
mber of resources that the workload utilizes
ity of the• transactions’
This upper limitdemands.
service is calledWemulti- DBMS
programming
ack based controller, augmentedlevelby(MPL)
queue- Figure 1. Simplified view of the mechanism used in
odels for automatically adjusting the MPL. external scheduling. A fixed limited number of trans-
y our methods to the specific problem of ex- actions (MPL=4) are allowed into the DBMS simul-
tion of transactions. We find that external taneously. The remaining transactions are held back
n be nearly as effective as internal prioriti- in an external queue. Response time is the time from
any negative consequences, when the MPL when a transaction arrives until it completes, includ-
tely. ing time spent queueing externally to the DBMS.
• “Operational”
• Collect performance data during day-to-day operation
• Operation laws
• Applications:
• Use the data for building queueing network models
• Perform bottleneck analysis
• Perform modification analysis
T1,2024 COMP9334 14
Single-queue example (1)
server
#requests = A #requests = C
B
In an observational period of T, server busy for time B
A requests arrived, C requests completed
T1,2024 COMP9334 16
Utilisation law
T1,2024 COMP9334 17
Application of OA
T1,2024 COMP9334 18
Equilibrium assumption
• OA makes the assumption that
• C=A
• Or at least C » A
• This means that
• The devices and system are in equilibrium
• Arrival rate of requests to a device = Output rate of requests for that
device = Throughput of the device
• The above statement also applies to the system, i.e. replace the word
“device” by “system”
T1,2024 COMP9334 19
OA for Queueing Networks (QNs)
The computer
system has K
devices, labelled
as 1,…,K.
The convention
is to add an
additional
device 0 to
represent the
outside world.
T1,2024 COMP9334 20
OA for QNs (cont’d)
T1,2024 COMP9334 21
Visit ratios
• A job arriving at the system may require multiple visits to a
device in the system
• Example: If a transaction arriving at the system requires 3 visits to
the disk (= device j), what is the ratio of C(j) to C(0)?
• We expect C(j)/C(0) = 3.
Trans C C C C
C Location
of the trans.
over time D D D
D Time
T1,2024 COMP9334 22
Forced Flow Law
Since
T1,2024 COMP9334 23
Service time versus service demand
T1,2024 COMP9334 24
Service demand
• Service demand can be expressed in two different
ways
• Ex: A job requires three disk accesses to be completed. One
disk access takes 20ms and the others take 30ms and
28ms.
• What is D(j)? 20+30+28 = 78ms.
• What are V(j) and S(j)?
• Recall that S(j) = mean service time of device j
• V(j) = 3. S(j) = 78/3 = 26ms.
T1,2024 COMP9334 25
Service demand law (1)
Since
• It is U(j)
T1,2024 COMP9334 26
Service demand law (2)
• Service demand law D(j) = U(j) / X(0)
• You can determine service demand without knowing the visit ratio
• Over measurement period T, if you find
• B(j) = Busy time of device j
• C(0) = Number of requests completed
• You’ve enough information to find D(j)
T1,2024 COMP9334 27
Server example exercise
Measurement time = 1 hr
CPU 0.35
Total # jobs=13680
T1,2024 COMP9334 28
Server example solution
Measurement time = 1 hr
CPU 0.35
Total # jobs=13680
T1,2024 COMP9334 30
Little’s Law (2)
Navg = X * Ravg
We will argue the validity of Little’s Law using a simple
example.
T1,2024 COMP9334 31
Consider the single sever queue example from Week 1A
Request index Arrival time Service time Departure time
1 2 2 4
2 6 4 10
3 8 4 14
4 9 3 17
3
4
2
3
1 time
1 2
2 4 6 10 14 17
T1,2024 COMP9334 32
3
4
2
3
1 time
1 2
2 4 6 10 14 17
Assuming that in the measurement time interval [0,20]
these 4 requests arrive and depart from this device, i.e. the device
is in equilibrium.
3
4
2
3 4
1 time
1 2 3 4
2 4 6 10 14 17
There is an interpretation of the height of the graph.
T1,2024 COMP9334 34
Request index Arrival time Service time
1 2 2
2 6 4
3 8 4
4 9 3
Requests
waiting
3 to be
4 processed
2
3 4 Request
1 being
1 2 3 4 processed
2 4 6 10 14 17 time
Interpretation: Height of the graph = #requests in the device
E.g. Number of requests in [9,10] = 3
E.g. Number of requests in [11,12] = 2 etc.
T1,2024 COMP9334 35
3 waiting
4 requests
2
3 4 Request
1 being
1 2 3 4 processed
2 4 6 10 14 17 time
T1,2024 COMP9334 36
3
4
2
3
1 time
1 2
2 4 6 10 14 17
Area = Average response time over [0,T] *
Number of requests completed in [0,T]
3 waiting
4 requests
2
3 4
Request
1
1 2 3 4 being processed
2 4 6 10 14 17 time
Area = Average number of requests in [0,T] * T
T1,2024 COMP9334 37
Deriving Little’s Law
T1,2024 COMP9334 38
Using Little’s Law (1)
queue server
T1,2024 COMP9334 40
Applicability of Little’s Law
• Little’s Law can be applied at many different levels
• Little’s law can be applied to a device
• Navg(j) = Ravg(j) * X(j)
T1,2024 COMP9334 41
T1,2024 COMP9334 42
Using Little’s Law (2)
queue server
T1,2024 COMP9334 44
References
• Operational analysis
• Lazowska et al, Quantitative System Performance, Prentice Hall, 1984.
(Classic text on performance analysis. Now out of print but can be download
from http://www.cs.washington.edu/homes/lazowska/qsp/
• Chapters 3 and 5 (For Chapter 5, up to Section 5.3 only)
• Alternative 1: You can read Menasce et al, “Performance by design”, Chapter
3. From beginning of Chapter 3 to Section 3.2.4.
• Alternative 2: You can read Harcol-Balter, Chapter 6. The treatment is more
rigorous. You can gross over the discussion mentioning ergodicity.
• Revision questions based on this week’s lecture are available from course
web site
T1,2024 COMP9334 45