Notes on System performance.
(Check these references.
Jeff Buzen: Fundamental laws of computer system performance, ACM SIGMETRICS.
P. Denning and J. Buzen: The Operational Analysis of Queuing Network Models, ACM
Computing Surveys, September 1978.
http://www.cs.washington.edu/homes/lazowska/qsp/Images/Chap_03.pdf )
By a system, in this case, we are referring to those that could be modeled as queuing
systems. A modern computer system is one such example, a service center with multiple
servers is another kind, etc. In this case, the customers desiring and receiving service
from systems are called clients, customers, jobs, task, requests, interactions, etc.
(depending on the context).
System S
Client arrivals
server
Client Queue(s) Completions
Consider a dynamic system S. It is dynamic because its states (system states) are
changing in time. Even if the system is non-determinate it is still possible to talk about its
time-average performance measures. Suppose, the system has been under observation for
a period of T secs and we observe the following:
the total number of customer arrival during T: A(T )
the total number of completions observed during T: C (T )
the busy time for the system during T: B (T )
B(T )
Avg. service time received by a client (or a task), S
C (T )
C (T )
Avg. system throughput, X
T
B(T )
System utilization during time T, U
T
From these, we see that U XS (1) The first fundamental law
Also, assume that when the system is in equilibrium the number of customers or clients
trapped within the system (awaiting for services, getting services, etc.) is N . Secondly,
we assume that on an average a client spends R secs in the system, the residency time.
Little’s Law (Residency Law)
Consider a system at equilibrium with a count of N clients inside it on the average.
Suppose a client, say C, now arrives the system at time t a . If he looks back he will see no
other client behind him since he is the last one to join the queue. Suppose, after R units
time at t c t a R he gets out of the system. As he now takes a look behind him he will
see on an average N customers behind him which took all these R units of time to
congregate. Since the system is in equilibrium, the arrival rate of the customers into it is
precisely its throughput X customers per unit time. Therefore,
N XR (2) The second fundamental law
This is Little’s law that connects customer’s residency time with customer-density within
the system. This law is very robust and works in all types of queuing organizations
(independent of queue disciplines employed within the system).
Little’s Law extended to Interactive systems
Consider an interactive system as depicted below where response from a terminal must
be considered part of the overall process of interaction. At the terminal, we assume the
average user spends Z units of sleep-time.
Interactive
User at this Sleep time = Z
Terminal
System user
Interacts with
An average customer spends all total R units of residency time. This could be seen as
X
R Residence time Z R( system)
N
X
Therefore, the response time at the system R( system) Z . If there is no confusion,
N
X
we could write it as R Z (3) Interactive Response Time
N
remembering though that R here is the response time of a system.
Forced Flow laws
We will expand the system to include a number of devices within it. Each device may be
a queuing device, may be just a counter through which a customer just transits through,
etc.
Suppose, for the device k , C k (T ) = total number of completions within the observed T
units of time. We consider visit count of the kth device to be
C k (T )
vk (4)
C (T )
C k (T )
And the device throughput to be X k . This shows
T
X k Xv k (5) Forced Flow Law
Every time a client visits a device it does receive a service from it lasting, we assume,
s k units of time per visit. Thus, the total service received by the client at that device
during its tenure in the system amounts to some
Dk v k s k (6a)
Multiplying by X from both sides, we get
XD k X k s k U k (6b)
as the utilization rate at the device k .
Examples.
1. Each job generates 50 disk requests. The disk utilization rate is 35%. The mean
service time at the disk is to be determined given that the overall interactive
response time is 1 sec with 25 terminals in the system and an average sleep time
of 19 secs.
U disk
Let s = disk-service time per visit. We have Xvdisk X disk
s
25
Therefore, s 0.35 / 50 X . Now from response time law: 1 19 and X 25 / 20.
X
Substituting this above, we get s 0.0056s
Bounds on performance measure
Consider a device k in an interactive system servicing clients. Since its utilization is
limited from above, we have
XDk U k 1
And this implies the system throughput X to be bounded as
1 1
X min or X (7a)
Dk Dm ax
Let D Dk be the total service received by an average client from all the devices in
k
the system.
Now, minimally a customer needs to spend a total of ( D Z ) units of time within the
system. If during this time the system could deliver service to all its N clients (via
maximum service parallelism the system can provide), we could receive maximum
system throughput in that case. Therefore, system throughput X will always be bounded
from above by
N
X (7b)
DZ
Combining (7a) and (7b), we get an upper bound for system throughput as
1 N
D ,DZ
X min (7c)
max
Notice that the lower bound for X could be ascertained as follows. The worst possible
system configuration for throughput would be the situation where all jobs or tasks are
processed in sequence without any service overlap or any built-in system parallelism. In
that case, the total set of N clients would spend ( ND Z ) units of time to flush out N
N
clients resulting in a throughput . Therefore,
ND Z
N 1 N
D ,DZ
X min (8a)
ND Z max
N /(D Z )
1 / D m ax
X
N
Taking reciprocals, we get
ND Z 1 DZ
max Dm ax ,
N X N
Multiplying this by N and then subtracting Z from it, we get
ND R max( NDmax Z , D) (8b)
as the interactive response time bound.
Note that the optimum number of active clients (beyond which system performance
DZ
deteriorates exponentially) is N * where N *
Dm ax
Example.
1. Consider a system with a single CPU and a single disk serving a set of terminals
where the average sleep time is Z=35 secs. Some possible configurations are
envisaged as shown below. The three pairs of ( Dcpu , D disk ) are considered:
(system A: (4.2, 4.0)), (system B: (5.0,2.9)) and (system C: (1.2, 2.1)). Determine
the optimum number of active terminals that could be connected to the system
without seriously affecting the system performance.
2. Consider a system with two disks: D1 and D2 and one CPU. The total service
times at these devices are: Dcpu 2.0 , Dd 1 2.5 and Dd 2 3.0 . The visit counts
to the disks are 50 and 70, respectively. The service time per visit to the disks is
0.03 and 0.05 secs, respectively. The average sleep time Z 20 secs. We consider
some possible improvements to the system by changing to the following
configurations:
a. Replace the current CPU with a faster CPU, Dcpu 1.0
b. Balance the total loads of the disks by shifting some of the contents from
the slower disk to the faster disk such that the total time taken at either of
the disk is the same.
c. Add a second faster disk to take half of the load of the slower disk. Now
we should have three disks with Dd 1 2.5 , Dd 2 Dd 3 1.5 .
d. All combined i.e. one faster CPU, plus load balancing across the three
disks leading to same disk time.
In BSD systems, one may obtain Virtual Memory Statistics (via vmstat call). Typical
usage
vmstat [-afimsz] [-c count] [-M core [-N system]] [-w wait] [-n devs] [-p
type,if,pass] [disks]
e.g.
sengupta@fang:~>vmstat 5
procs memory page disks faults cpu
r b w avm fre flt re pi po fr sr da0 da1 in sy cs us sy id
1 1 0 358684 430064 18 0 0 0 38 10 0 0 304 345 646 0 0 99
0 0 0 349564 443768 1 0 0 0 731 0 0 0 525 179 1142 0 2 98
0 0 0 349564 443772 0 0 0 0 2 0 2 0 159 68 370 0 0 100
0 0 0 349564 443756 0 0 0 0 0 0 0 0 167 160 381 0 0 100
^C
sengupta@fang:~>
In this case, stats are obtained every 5 secs. The entries are averages since the system
start. Between intervals, vmstat sleeps using no CPU. avm and fre are memory stats as
seen by kernel (and not vmstat). Kernel updates these every 5 secs.
r,b,w: number of processes in run queue, blocked and runnable but swapped
avm, fre : number of active virtual pages, number of pages in free list
page: information about page faults and paging activities
(flt: total page fault rate, re: page reclaims, pi: paged in, po: paged out
fr: pages freed per sec, sr: pages scanned by clock algorithm per sec)
disks: disk operations per sec
faults: trap/interrupts rate averaged over 5 secs.
in: device interrupts per interval (includes clock interrupts)
sy: system calls per interval
cs: CPU context-switch rate
cpu: breakdown of CPU usages
us: user utilization rate
sy: system utilization rate
id: idle time