Art of computer systems performance analysis techniques for experimental design measuremet

67

description

Art of computer systems performance analysis techniques for experimental design measuremet

Transcript of Art of computer systems performance analysis techniques for experimental design measuremet

Page 1: Art of computer systems performance analysis techniques for experimental design measuremet

Solution Manual

for

The Art of ComputerSystems Performance Analysis

Techniques for Experimental Design�Measurement� Simulation� and Modeling

By

Raj Jain

Professor of CIS

���� Neil Avenue Mall� ��� Dreese Lab

Columbus� OH ���������

Internet Jain�Cis�OhioState�Edu

Tentative Publication Date August ����

Copyright ���� Raj Jain

Please do not copy without Author�s written

permission�

Copy No� For

Page 2: Art of computer systems performance analysis techniques for experimental design measuremet

��� � Compare the ratio with system A as the base

System Workload � Workload � AverageA � � �B ���� � ����

Considering the ratio of performance with system A as base� we con�clude that system B is better�

� Compare the ratio with system B as the base

System Workload � Workload � AverageA � ���� ����B � � �

Considering the ratio of performance with system B as base� we con�clude that system A is better�

Page 3: Art of computer systems performance analysis techniques for experimental design measuremet

��� incomplete

��� Can be done

Page 4: Art of computer systems performance analysis techniques for experimental design measuremet

��� a� Measurements� Run your favourite programs and pick the one thatruns them faster�

b� Use measurements and simulations of various network conguirations�

c� Measurement�

d� a� Analytical modelling

b� Analytical modelling and simulations�

c� Extensive simulations and modelling�

��� a� � Response time for commonly used programs�

� Failure rate rate of crashing��

� Storage capacity�

� User�friendliness�

b� � Query response time�

� Failure rate�

� Storage capacity�

� Usability�

c� � Capacity�

� Response time�

� Failure rate�

d� � Response time�

Page 5: Art of computer systems performance analysis techniques for experimental design measuremet

��� The following information is from SPEC Standard Performance EvaluationCorporation� home page�

CPU benchmarks

CINT��� current release Rel� ���� Integer benchmarks contains

Name Applicationespresso Logic Design

li Interpretereqntott Logic Designcompress Data Compression

sc Spreadsheetgcc Compiler

CFP��� current release Rel� ����

Floating point benchmark suite contains

Name Applicationspice�g� Circuit Designdoduc Simulation

mdljdp� Quantum Chemistrywave� Electromagnetism

tomcatv Geometric Translationora Optics

alvinn Roboticsear Medical Simulation

mdljsp� Quantum Chemistryswm��� Simulationsu�cor Quantum Physicshydro�d Astrophysicsnasa� NASA Kernelsfpppp Quantum Chemistry

More information about these benchmarks can be found in http���performance�netlib�org�performaweb page�

��� A C program to implement sieve workload�

��

� seive�c � Program to implement sieve workload

��

Page 6: Art of computer systems performance analysis techniques for experimental design measuremet

�include �stdio�h�

�define MaxNum ��� �� List all primes upto MaxNum ��

�define NumIterations � �� Repeats procedure NumIterations times ��

�define TRUE �

�define FALSE

void main�void�

int IsPrime�MaxNum����

int i�k�Iteration� �� Loop indexes ��

int NumPrimes� �� Number of primes found ��

printf��Using Eratosthenes Sieve to find primes up to �d�n�� MaxNum��

printf��Repeating it �d times��n��NumIterations��

for �Iteration � �� Iteration �� NumIterations� Iteration���

�� Initialize all numbers to be prime ��

for �i � �� i �� MaxNum� i���

IsPrime�i� � TRUE�

i � ��

while �i�i �� MaxNum�

if �IsPrime�i��

�� Mark all multiples of i to be nonprime ��

k � i � i�

while �k �� MaxNum�

IsPrime�k� � FALSE�

k � k � i�

� �� of while k ��

� �� of if IsPrime ��

i � i � ��

Page 7: Art of computer systems performance analysis techniques for experimental design measuremet

� �� of WHILE i�i ��

NumPrimes � �

for �i � �� i �� MaxNum� i���

�� Count the number of primes ��

if �IsPrime�i��

NumPrimes � NumPrimes � ��

printf���d primes�n��NumPrimes��

� �� of for Iterations ��

�� The following can be added during debugging to list primes� ��

�� for �i � � i � MaxNum� i���

if �IsPrime�i�� printf���d�n��i�� ��

The result of running the program

Using Eratosthenes Sieve to find primes up to ���

Repeating it � times�

�� primes

�� primes

�� primes

�� primes

�� primes

�� primes

�� primes

�� primes

�� primes

�� primes

Page 8: Art of computer systems performance analysis techniques for experimental design measuremet

��� a� Cannot compare systems o�ering di�erent services�

b� � Metric response time�

� Workload Favourite programs Word processor� spreadsheet�

c� Metric response time� functionality Workload A synthetic programwhich tests the versions using various operating system commands�operating system services�

d� � Metric Response time� reliability� time between failures

� Workload A synthetic program generating representative �oppydrive I�O requests

e� � Metric size of code� structure of code� execution time

� Workload A representative set of programs in C and Pascal�

Page 9: Art of computer systems performance analysis techniques for experimental design measuremet

��� a�

�tCPU ��

n

nXi��

tCPU ���

�� �����

�nI�O ��

n

nXi��

nI�O ��� ���

�� �����

s�xs ��

n� �

nXi��

xsi � �xs��

��

n� �

��nXi��

x�si

�� n�x�s

����� �� ������

�� �����

Similarly�

s�xr ��� ���� ���� �� ����

�� �������

b� Normalize the variables to zero mean and unit standard deviation� Thenormalized values x�s and x�r are given by

x�s �xs � �xssxs

�xs � �����

����

x�r �xr � �xrsxr

�xr � ���

������

The normalized values are shown in the fourth and fth columns ofTable b�

The other steps are similar to example ����

Page 10: Art of computer systems performance analysis techniques for experimental design measuremet

��

Observation Variables Normalized Variables Principal FactorsNo� xs xr x�s x�r y� y�

� �� ���� ����� ����� ����� ������� �� ��� ����� ������ ����� ������ � �� ����� ������ ������ ������ � �� ������ ������ ������ ������ � �� ������ ������ ������ ������ � �� ������ ������ ������ ������� � �� ������ ������ ������ ������Px �� ����� ����� ����� ����� �����Px� ��� ��������� ����� ����� ����� �����

Mean ���� ����� ����� ����� ����� �����StandardDeviation

���� ������ ����� ����� ����� �����

The correlation between CPU time tCPU� and number of I�O�s nI�O�

is ������ The principal factors y� and y� are

�y�y�

��

� �p�

�p�

�p�� �p

� ���tCPU�����

����nI�O

�����

����

��

The rst factor explains ������������������ or ��� of total variation�

��� There is no unique solution to this exercise� Depending upon the choice ofoutliers� scaling technique� or distance metric� di�erent results are possible�all of which could be considered correct� One solution using no outliers� rangenormalization to ����� and Euclidean distance starts with the the normalizedvalues shown in the following

Program CPU time I�O�sTKB ���� ����MAC ���� ����COBOL ���� ����BASIC ���� ����Pascal ���� ����EDT ���� ����SOS ���� ����

BASIC� Pascal� EDT� COBOL� SOS� MAC� and TKB join the dendro�gram at distances of ����� ����� ����� ����� ����� and ����� respectively�

Page 11: Art of computer systems performance analysis techniques for experimental design measuremet

��

Other possibilities are to discard TKB and MAC as outliers� normalizeusing the mean and standard deviation� and transform I�O�s to a logarithmicscale� All these and similar alternatives should be considered correct provideda justication is given for the choice�

Page 12: Art of computer systems performance analysis techniques for experimental design measuremet

��

��� a� Hardware monitor as software monitor cannot measure time�

b� Software monitor becuase with hardware it is di�cult to monitor soft�ware events�

c� Software monitor� Program reference is a software event

d� Hardware monitor� Virtual memory reference is a hardware event�

e� Hardware monitor� Software interferes with time measurements�

f� Software monitor� Database query is high�level software� event�

��� Let us choose a network card our computer subsytem� Then the quantitiesthat can be monitored using the di�erent monitors are as follows

a� Software monitor� Total number of packets received� total number ofpackets sent� Number of error packets� Total bytes sent�

b� Hardware monitor� Record of all tra�c to the card using promiscuousmode��

c� Firmware monitor� The card be programmed to monitor tra�c onlyfrom a particular node�

For the software monitor� using the quantities one could measure theaverage packet size� error rate in packets� For the hardware monitor� therecord of tra�c can be used to measure time between packet arrivals� Forthe rmware monitor� the number of packets received from a particular nodecan be measured�

Page 13: Art of computer systems performance analysis techniques for experimental design measuremet

��

�� a� Those with the largest number of terminal reads�writes per CPU sec�ond�

a� Find the average number of disk reads�writes per second of programX� and the maximum rate that the disk can support� The ratio givesyou the number of copies of program X that can run simultaneously onthe disk drive�

a� Find the mode of typical data recorded by the log and compare thatwith data of the benchmark� If they are close� then the benchmark isrepresentative�

a� I�O bound programs � those with high �disk I�O�s per CPU second�should be chosen for I�O optimization�

Page 14: Art of computer systems performance analysis techniques for experimental design measuremet

��

��� incomplete

��� incomplete

Page 15: Art of computer systems performance analysis techniques for experimental design measuremet

��

��� a� Bar chart� as intermediate values have no meaning�

b� Line chart� as intermediate values have meaning�

c� Bar chart� no meaning for intermediate value�

d� Line chart� intermediate values have meaning�

��� a� a� Axes lables are not self�explanatory�

b� Scales and divisions are not shown

c� Curves are not labelled�

b� a� Y�axis is not labelled�

b� No Y�axis scales and division are not shown�

c� Y�axis minimum and maximum are not appropriate�

c� a� Scales and divisions are not shown�

b� Too many curves�

c� Curves are not individually labelled�

d� a� Order of bars is wrong�

b� Y�axis scales divisions not shown

��� incomplete

��� FOM � ��

��� FOM � ��

Page 16: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� Raw Execution Time is a LB Lower is better� parameter�

� Compare the ratio with system A as the base

Benchmark System A System B SystemI ���� ���� ����J ���� ���� ����K ���� ���� ����

Average ���� ���� ����

Considering the ratio of performance with system A as base� we con�clude that system A is better�

� Compare the ratio with system A as the base

Benchmark System A System B SystemI ���� ���� ����J ���� ���� ����K ���� ���� ����

Average ���� ���� ����

Considering the ratio of performance with system B as base� we con�clude that system B is better�

� Compare the ratio with system A as the base

Benchmark System A System B SystemI ���� ���� ����J ���� ���� ����K ���� ���� ����

Average ���� ���� ����

Considering the ratio of performance with system C as base� we con�clude that system C is better�

Page 17: Art of computer systems performance analysis techniques for experimental design measuremet

��

System A System BTest Total Pass � Pass� a ax ���� x� b by ���� y

Total a � b ax � by �ax�by�a�b

Test Total Pass � Pass� c cu ���� u� d dv ���� v

Total c� d cu� dv ����cu�dv�c�d

���� Consider two systems A and B with two experiments�

System A is better than B based on the individual experiments� if the fol�lowing conditions are satised

���� x � ���� u

and���� y � ���� v

These conditions simplify to

x � u and y � v

System A is better than B based on total both the experiments�� if

���ax� by�

a � b�

���cu� dv�

c� d

which simplies toax � by�

a� b�

cu� dv�

c� d

If any of the above conditions are satised then the percentages can be usedfor system A�s advantage�

Page 18: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� a� The servers are chosen independently with equal probablility� thereforethe probability that server A is chosen P A� � �

��

b� P AorB� � P A� � P B� � P AandB�� Only one server at a time isselected� so P AandB� � �� Thus P AorB� � �

��

c� �� Only one server at a time is selected�

d� P �A� � �� P A� � ���

e� Successive selections are independent� so we can multiple their proba�bilities� Thus P AA� � �

�� �

�� �

��

f� All nine events are independent� each with probablility ��� therefore the

probability that they occur in sequence is ����

���� The distribution is geometric� The mean of a geometric distribution withpmf � � p�x��p is � � �

p� The variance �� � ��p

p�� The standard deviation

� �p��pp

� The Coe�cient of variation COV � ���p�� p�

���� The mean of a Poisson distribution with pmf �x e��x

x is � � �� The variance

�� � �� The COV � ���p��

���� From ����� we know that the mean and variance of a Poisson distributionwith pmf � � p�x��p are equal to �� x and y are independent randomvariables�

a� Meanx � y� � Meanx� �Meany� � ���

b� V arx � y� � V arx� � V ary� � ���

c� Meanx � y� � Meanx� �Meany� � ��

d� V arx� y� � V arx� � V ary� � ���

e� Mean�x� �y� � �Meanx� � �Meany� � ���

f� V ar�x � �y� � �V arx� � ��V ary� � ���� COV �pV ar�Mean �

�p��

Page 19: Art of computer systems performance analysis techniques for experimental design measuremet

��

����

pdf � fx� �dF x�

dx

�e�x�a

a

�m��Xi�

x�a�i

i�

�� e�x�a

�m��Xi�

x�a�i

a � i�

�xm��e�x�a

m� ���am

Mean � � �Z �

xfx�dx

�Z �

xme�x�a

m� ���amdx

��

m� ���am

Z �

xme�x�adx

Integrating by parts

��

m� ���am

h�axme�x�a

i�

�am

m� ���am

Z �

xm��e�x�adx

�am

m� ���am

Z �

xm��e�x�adx

�amm�

m� ���am

Z �

e�x�adx

� mZ �

e�x�adx

� amh�e�x�a

i�

� am��� ����

� am

Variance � �� �Z �

x� ���fx�dx

��

m� ���am

Z �

x� am��xm��e�x�adx

��

m� ���am

Z �

xm�� � �amxm � a�m�xm���e�x�adx

Page 20: Art of computer systems performance analysis techniques for experimental design measuremet

��

�a�m� ��m� �a�m� � a�m�

m� ���am

Z �

xm��e�x�adx

� a�m

Mode is the maximum possible probability�

fx� is maxium whendfx�

dx� �

dfx�

dx�

m� ���amm� ��xm��e�x�a� xm��e�x�a� � �

xm��e�x�a

m� ���amm� ��� x�a� � �

Therefore mode occurs at x � am� ��

C�O�V ��

��

pa�m

am�

�pm

����

pdf � fx� �dF x�

dx� ax�a���

Mean � � �Z �

�xfx�dx

�Z �

�ax�adx

� a

�x�a��

�a� ��

���

�a

a� �

Variance � �� �Z �

�x� ���fx�dx

�Z �

�x� a

a� ���ax�a���dx

Integrating by parts

Page 21: Art of computer systems performance analysis techniques for experimental design measuremet

��

� a

�x� a

a� ���x�a

�a

���

� �Z �

�x� a

a� ��x�adx

��

a� ���� �

�x� a

a� ��x�a��

�a � �

���

��

�a � �

Z �

�x�a��dx

��

a� ���� �

a� ����

�a � �

�x�a��

�a � �

���

���

a� ����

a� ��a� ��

��a� �� a � �

a� ���a� ��

�a

a� ���a� ��

C�O�V ��

��

sa

a� ���a� ��

a� �

a

��q

aa� ��

� �aa� ����

���� The pdf for normal distribution is given by�

fx� ��

�p��

e��x����

���

Here � � � and � � �� Hence�

fx� ��p��

e��x����

For pdf values for x � �� � � � � � are tabluated below�

Page 22: Art of computer systems performance analysis techniques for experimental design measuremet

��

x fx�� ��������� ��������� ��������� ��������� ��������� ��������� ��������� ��������

Total ��������

a� P X � �� � � � P X � �� � � �P�i�� fi� � ��� xxx answer

in the book is wrong�

b� P X � �� �P�

i�� fi� � ����� xxx answer in the book is wrong�

c� f�� � f�� � f�� � f�� � �������� � ����� xxx answer in thebook is wrong�

d� P x � � � z��� � Here � ���� From appendix table A��� z��� ������� Hence x � � � ������ � � ����� seconds

��� a� The distribution is not skewed� nor is the data categorical� so we usethe Mean�

b� The total number of packets makes sense� also the distribution is notskewed� so we use the Mean�

c� The distribution is skewed� so we use the Median�

d� The keywords constitute categorical information� hence we use theMode�

���� a� CPU type is a category� so we would use Mode to summarize it�

b� Memory size is typically skewed � most personal compters have ap�proximately the same amount of memory� but a few users have lots ofmemory � so the Median is the best choice�

c� Disk type is a category� so we would use the Mode�

Page 23: Art of computer systems performance analysis techniques for experimental design measuremet

��

d� Number of peripherals is skewed� so the Median is a good choice�

e� Using the same logic as for memory size and number of peripherals� wechoose the Median�

���� Since the ratio of maximum to minimum is very high� use the median� Thegeometric mean can also be used if a logarithmic transformation can bejustied based on physical considerations�

����� Arithmetic mean since the data is very clustered together not skewed� andymax�ymin ratio is small�

����� Use SIQR since the data is skewed�

����� Range � � to �� Variance � �� ���percentile � �� � ��������� � �thelement � �� ���percentile � �� � �������� � ��th element � �� Semi�Interquartile RangeSIQR� � Q��Q�

�Q � � �th element � �� Q � � ��th

element � �� SIQR � ��� a� ��� Coe�cient of Variation � ����

Use the coe�cient of variation or standard deviation� since the datais not skewed�

����� The normal quantile�quantile plot for this data is shown in Figure ���� ofthe book� From the plot� the errors do appear to be normally distributed�

Page 24: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� The normal distribution has the linearity property� Hence� the means getadded� when sum of two normal distribution are taken� The variance is givenby

� �

s���

n�����

n�

a� From central limit theorem N�� ��pn� is the distribution of the sam�

ple means� Here � � �� Hence the distribution is N�� ��pn�

b� mean � �� � �q��n� ��n �

q��n� Hence the distribution is

N�q��n� xxx answer in the book is wrong�

c� mean � ��� � ��� � �q��n� ��n �

q��n� Hence the distribution

is N���q��n��

d� mean � ���� � �� � �� � �q���n� ���n � ��

p�n� Hence the

distribution is N�� ��p�n��

e� The sum of square of normal variates has the chi�square �n� distri�bution�

f� The sum of the variance has ��n� distribution�

g� The ratio of two chi�square distribution has an F distribution� Hereboth numerator and denominator have the same chi�squre distribution�Hence� F n� n� is the distribution for the ratio of variances�

h� If x is normal variate and y � ��� then x�qy�� where � is the degrees

of freedom� has a t distribution� Here x��� is normal variate� sx has�n� distribution� The degrees of freedom is n� hence x����sx�

pn�

has tn� distribution�

���� The numbers in the sorted order is f �� ��� ��� ��� ��� ��� ��� ��� ��� ��� ������ ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� �����g� There are n � �� numbers�

a� The ���p�percentile is xp � x���n���p��� Therefore x����������� � x� ��� and x����������� � x� � ��

Page 25: Art of computer systems performance analysis techniques for experimental design measuremet

��

b� Mean � ����P��

i�� xi � ������ � �����

c� s� � �n��

Pni��xi � �x�� � �������� There s �

p������� � �������

A ��� condence interval for the mean � ��������������������p��

� ������ ������

d� Number of programs with less than or equal �� I�O�s � ��� Fraction� ����� � ����

A ��� condence interval for the fraction � p� z�����

sp�� p�

n

� ������ z

s������� ������

��

� ������ ������������

� ����� �����

xxx answer in book is wrong� gives ��� C�I�s�

e� One�sided condence interval for mean is given by�x� �x � z���s�

pn� or �x� z���s�

pn� �x��

��������������������p��� ������ or ������ ��������������������

p���

������ ������ or ������ �����

���� The standard deviation for the codes are sRISC�I � �������� sZ�� ���������sV AX������ � �������� sPDP����� � �������� sC�� � �������� The ���

condence interval is given by �x � t�������s�p��� since n � �� is less than

��� The condence intervals are CIRISC�I � �������� ��������� CIZ�� ��������� ��������� CIV AX������ � �������� ��������� CIPDP����� � ������� ���������CIC�� � ������� ��������� xxx answer in the book is wrong�

Let us choose RISC�I and Z���� as the two systems�

a� The condence intervals for both the processors include �� so if theprocessors are not di�erent�

b� incomplete� question not clear �

Page 26: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� incomplete refer math book to use Langrange multiplier technique�

���� A linear model to predict disk I�O�s as a function of CPU time can bedeveloped as follows

For this data n � �� !xy � ����� !x � ��� !x� � ���� !y � ���� !y� � ��� ���� �x � ������y � ������ Therefore�

b� �!xy � n�x�y

!x� � n�x���

����� �� ����� �����

���� �� ������� ������

b � �y � b��x � ������ ������� ���� � ������

The desired model is

Number of disk I�O�s � ������ � ������CPU time�

SSE � !y��b!y�b�!xy � ��� �������������������������� � ������

SST � SSY� SS� � !y� � n�y�� � ��� ���� �� ������� � �������

SSR � SST� SSE � �������� ������ � �������

R� �SSR

SST�

�������

�������� ������

Thus� the regression explains ��� of CPU time�s variation�

The mean squared error is

MSE �SSE

Degrees of Freedom for Errors�

������

�� �����

The standard deviation of errors is

se �pMSE �

p����� � �����

sb� � se

��

n�

�x�

!x� � n�x�

����� �����

��

��

������

���� �� ����� ����

����� ������

sb� �se

�!x� � n�x������

�����

����� �� ����� ��������� ������

Page 27: Art of computer systems performance analysis techniques for experimental design measuremet

��

The ��� condence interval for b is

������� ������������� � ������� ������ � �������� �������

Since this includes zero b is not signicant�

The ��� condence interval for b is

������� ������������� � ������� ������ � ������� �������

a� Only b� is signicant�

b� ��� xxx answer in book is wrong it said ��

c� yexpected � ������ � ������ � �� � �������

d�

s�y�p � �����

�� �

��

��� ������

���� �������

����� �������

The ��� condence interval for a single prediction � ��������� ��������������

� ��������� �������

� ������� �������

xxx answer in book is wrong ������� ������� �

e�

s�y�p � �����

��

��

��� ������

���� �������

����� �������

The ��� condence interval for predicted mean � ��������� ��������������

� ��������� �������

� ������� �������

xxx answer in book is wrong ������� ������� �

Page 28: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� For the data n � �� !xy � ��� ���� !x � ����� !x� � ���� ���� !y � ��� !y� � �����x � ������� �y � ����� Therefore�

b� �!xy � n�x�y

!x� � n�x���

��� ���� �� ������� ����

���� ���� �� ��������� ������

b � �y � b��x � ����� ������� ������ � ������

The desired model isCPU time in milliseconds � ������ � ������� memory size in kilobytes�

SSE � ������� SST � ��������� SSR � ��������� R� � ������MSE � ������� se � ������� sb� � ������� sb� � �������

The ��� condence intervals of b and b� are �������� ������� and������� �������� the intercept is zero but the slope is signicant�

���� Elasped time � ����� number of days� � ������ the ��� condence intervalsfor the regression coe�cients are ����� ����� for the intercept and ���������� for the slope� both are signicant� Note Calculations are similar tothe solution for exercise �����

���� Elapsed time � ������������number of keys�� R� � ������ the condenceintervals of the coe�cients are ������������ and ������������� respectively�Note Calculations are similar to the solution for exercise �����

���� Number of disk I�O�s � ������ � ����� � number of keys�� R� � ������ the��� condence intervals for the coe�cients are �������� ������� and ������������ b is not signicant� Note Calculations are similar to the solutionfor exercise �����

���� Time � ���������� � ������ record size�� R� � ������ Both parametersare signicant� However� the scatter plot of the data shows a nonlinearrelationship� The residuals versus predicted estimates show that the errorshave a parabolic trend� This indicates that the errors are not independentof the predictor variables and so either other predictor variables or somenonlinear terms of current predictors need to be included in the model�

Page 29: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� yyy question not clear� no x�� but solution talks about x�� �

a� R � ���� R� � ������� So ������ of variance is explained by theregression�

b� Yes

c� x�

d� x�

e� x�� x�� and x�

f� Multicollinearity possible

g� Compute correlation among predictors and reduce the number of pre�dictors�

Table ���� Time to Encrypt a k�bit Record after log tranformation�

����

log�k� Uniprocessor Multiprocessor����� ����� ���������� ����� ���������� ����� ���������� ����� �����

Let us use the following model

y � b � b�x� � b�x�

where y is logtime�� x� is the key size and x� is a binary variable�x� � � � multiprocessor and x� � ��uniprocessor�

In this case

X �

���������������

� ����� �� ����� �� ����� �� ����� �� ����� �� ����� �� ����� �� ����� �

��������������

Page 30: Art of computer systems performance analysis techniques for experimental design measuremet

��

XTX �

��� � ������ �

������ ������ ������� ������ �

��

C � XTX��� �

��� ����� ������ ����������� ����� ������ � ���

��

XTy �

��� ������

������������

��

The regression parameters are

b � XTX���XTy � ������� �������������T

The regression equation is

logtime� � ������ � ����� logkey size�� �����x�

R� � ������� The condence intervals of the coe�cients are ������������� ����� ������ and ������ �������

Page 31: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� Each of the factors have � levels�

a� A full factorial experiment is necessary if there is signicant interactionamong factors� Hence� number of experiments is �� �� � � ���

b� If there is no interaction among factors� then simple design can be used�The number of experiments is � � �� �� � �� �� � �� �� � � �

c� A fractional factorial experiment can be used if the interaction is smallamong factor� Hence� number of experiments is ���� � �

xxx answer in book is wrong� The answers for b� and c� are interchanged�

Page 32: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� The sign table for this data is given below

I A B C AB AC BC ABC y� �� �� �� � � � �� ���� � �� �� �� �� � � ���� �� � �� �� � �� � ��� � � �� � �� �� �� ���

� �� �� � � �� �� � ��� � �� � �� � �� �� ��� �� � � �� �� � �� ��� � � � � � � � ����� �� ���� ���� ��� �� ��� �� Total������ ����� ������� ������� ������ ����� ������ ����� Total��

SST � ��q�A � q�B � q�C � q�AB � q�AC � q�BC � q�ABC�

� ������� � ������� � ������� � ������ � ������ � ������� � �������

� ������ � �������� � �������� � ������ � ������ � �������� � �������

� ���������

a� q � ������ qA � ����� qB � ������� qC � ������� qAB � ������qAC � ����� qBC � ������ and qABC � ����

b� The portion of variation explained by the seven e�ects are ����������������������������������������� ������������ ���������������� ����������������������� ������� ������������������ �������� and ������������������������ respectively�

c� Sorting according to their coe�cient values� the factors with decreasingorder of importance are BC� C� B� ABC� A� AB� AC

Page 33: Art of computer systems performance analysis techniques for experimental design measuremet

��

��� Let A indicate workload and B indicate Processor�s used�

I A B AB y Mean �y� �� �� � ������ ������ ������ ������� � �� �� ������������������ ������� �� � �� ������������������ ������� � � � ������������������ ������������� ������ ������ ������� Total����� ������ ����� ������ Total��

The e�ects are ������ ����� ������ and ������ The e�ect of workloads������ is not signicant� Interactions explain ������ of the variation�

Page 34: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� The following sign table with I � ACD as the generator polynomial is usedto analyze the ���� design�

I A B C AB D BC BD y� �� �� �� � � � �� ��� � �� �� �� �� � � ���� �� � �� �� � �� � ��� � � �� � �� �� �� ���� �� �� � � �� �� � ��� � �� � �� � �� �� ��� �� � � �� �� � �� ��� � � � � � � � ����� ��� �� ���� �� ���� �� ��� Total������ ������ ����� ������� ����� ������� ����� ������ Total��

a� q � qACD � ������ qA� qCD � ����� qB � qABCD � ������� qC � qAD �������� qAB � qBCD � ������ qAC � qD � ����� qBC � qABD � ������and qABC � qBD � ����

b� ������ ������� ������� ������ ������ ������� �����

c� BC� C� B� BD� A� AB� D� Higher order interactions are assumedsmaller�

d� The generator is I � ACD� The confoundings are

I � ACD� A � CD� B � ABCD� C � AD� D � AC� AB � BCD�BC � ABD and ABC � BD

e� I � ABCD may be better since its resolution will be IV�

f� RIII� since the generator is I � ACD�

���� Yes� I � ABC is a ����

III design� yes� I � AB is a ����

II design� yes� I � ABCD

is a ����

IV design�

Page 35: Art of computer systems performance analysis techniques for experimental design measuremet

��

��� Rewrite the given equation as

j �rXi��

aXk��

aikjyik

We know thatj � �y�j � � � �y�j � �y��

Expanding the terms for �y�j and �y�� we get the following equation�

j ��

r

rXi��

yij � �

ar

rXi��

aXk��

yik

Collecting the terms we get

j � �

r� �

ar�

rXi��

yij � �

ar

rXi���i��j

aXk��

yik

Comparing the coe�cients of yij we get

aikj �

�r� �

ra� k � j

��ra� Otherwise

xxx answer in book is wrong� it gives ��ar instead of ���ar�

The variance of eij can be written as

��e�j

� ��e

rXi��

aXk��

aikj

��e�j

�r��

r� �

ra

��

� ar � r��

ra

�����e

ra�a� ��� �

ra�a� ��

���e

�a� ��

ra�a� �� � ��

���e

�a� ����

e

ar

Page 36: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ���� Computation of E�ects for the Scheme versus Spectrum Study

Row Row RoWorkload Scheme�� Spect��� Spect���� Sum Mean E�eGarbage Collection ����� ����� ����� ������ ����� ����Pattern Match ����� ����� ����� ����� ����� �����Bignum Addition ������� ������� ������� ������ ������ �����Bignum Multiplication ����� ����� ����� ����� ����� �����Fast Fourier Transform ����� ����� ����� ����� ����� ������ ����Column Sum ������ ������� �������� �������Column Mean ������ ������ ������ ������Column e�ect ������ ����� ������

���� The computation of e�ects for Scheme versus Spectrum study is given intable ����

SSY �Xij

y�ij � ��� �������

SS� � ab�� � �� �� �������� � �� �������

SSA � bXj

�j � �� ��������� � ������� � ��������� � �������

SSB � aXi

��i � �� ��������� � ��������� � ��������� � ��������� � ���������

� �� �������

SST � SSY� SS� � ��� �������� �� ������� � ��� �������

SSE � SST� SSA� SSB � ��� �������� �������� �� ������� � ��������

The di�erences of the e�ects of di�erent processors are������������ �������� ������ � ����� � ������ and ����� � ����� � �������

MSE �SSE

a� ��b� ��

MSE ���������

�� ���� ��� �������

se �pMSE �

p������� � ������

Page 37: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ���� Computation of E�ects the Intel iAPX ��� Study

System Workload Row Row RowNo� ��� Sieve Puzzle Acker Sum Mean E�ect� ����� ����� ����� ����� ������ ����� �������� ����� ����� ����� ����� ������ ����� �������� ����� ����� ����� ����� ������ ����� �������� ����� ����� ����� ����� ������ ����� �������� ����� ����� ����� ����� ������ ����� �������� ����� ����� ����� ����� ������ ����� ������� ����� ����� ����� ����� ����� ����� �������� ����� ����� ����� ����� ������ ����� �������� ����� ����� ����� ����� ������ ����� �������� ����� ����� ����� ����� ������ ����� �������� ����� ����� ����� ����� ������ ����� �������� ����� ����� ����� ����� ������ ������ ������

Column Sum ����� ������ ������ ������ �������Column Mean ����� ����� ����� ����� �����Column E�ect ������ ������ ����� �����

The standard deviation for the di�erences � se�p� � ������������ �

������

The condence intervals for the di�erences are

������ ���� � ������ � ������ �������� � �������� ������

������� ���� � ������ � ������� �������� � �������� �������

������� ���� � ������ � ������� �������� � ������� �������

The processor are not signcantly di�erent� The plots of residul errorsdoes not show any trend and the plot of normal quantile�quantile plot doesappear linear� But since the ymax�ymin is large a multiplicative model shouldbe used�

���� The table after the log transformation is shown in table �����

The ANOVA for Scheme versus Spectrum study is given in table �����which agrees with the table ����� given in the book�

Page 38: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ���� ANOVA Table for the Intel iAPX ��� Study

Compo� Sum of �Variation DF Mean F � F �nent Squares Square Comp� Tabley �������y�� �������y � y�� ������� ������ ��Workload ������� ����� � ���� ������ ���System ������ ����� �� ��� ���� ���Errors ���� ���� �� ����

se �pMSE �

p���� � ����

���� After logarithmic transformation� the table for computing e�ects is shownin table �����

The ANOVA table for RISC Code size study is given in table �����

The condence intervals for e�ect di�erences are shown in table �����

a� ����� variation is explained by the processors

b� ������ variation is due to workloads�

c� Yes� several processor pairs are signicantly di�erent� at ��� con�dence level�

���� After log transformation� the table for computing e�ects including �����column� is given in table �����

The ANOVA table including ����� column is given in table �����

The condence intervals of e�ect di�erences for RISC code study in�cluding column ����� is given in table ������

a� ����� variation is explained by the processors�

b� ������ variation is due to workloads�

c� Yes� several processor pairs are signicantly di�erent at ��� condencelevel�

Page 39: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ���� Computation of E�ects for the RISC Code Size Study

Processors Row Row RowWorkload RISC�I Z���� VAX������� PDP������ C��� Sum Mean E�ectE�String Search ���� ���� ���� ���� ���� ����� ���� ����� �

F�Bit Test ���� ���� ���� ���� ���� ����� ���� �����H�Linked List ���� ���� ���� ���� ���� ����� ���� �����K�Bit Matrix ���� ���� ���� ���� ���� ����� ���� �����I�Quick Sort ���� ���� ���� ���� ���� ����� ���� ����Ackermann���� ���� ���� ���� ���� ���� ����� ���� �����Recursive Qsort ���� ���� ���� ���� ���� ����� ���� ����Puzzle Subscript� ���� ���� ���� ���� ���� ����� ���� ����Puzzle Pointer� ���� ���� ���� ���� ���� ����� ���� ����SED Batch Editor� ���� ���� ���� ���� ���� ����� ���� ����Towers Hanoi ��� ���� ���� ���� ���� ���� ����� ���� �����Column Sum ����� ����� ����� ����� ����� ������Column Mean ���� ���� ���� ���� ���� ����Column E�ect ���� ���� ����� ����� �����

Table ���� ANOVA Table for RISC Code Size Study

Compo� Sum of �Variation DF Mean F � F �nent Squares Square Comp� Tabley ������y�� ������y � y�� ����� ������ ��Workload ���� ����� � ���� ���� ����System ����� ������ �� ���� ������ ����Errors ���� ����� �� ����

se �pMSE �

p���� � ����

Page 40: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ���� Condence Intervals of E�ect Di�erences in the RISC Code SizeStudy

RISC�I Z���� VAX������� PDP������ C���RISC�I �����������y ����� ����� �����������y ����� �����Z���� ����� ����� ����� ����� ����� �����

VAX������� �����������y ������ �����yPDP������ ������ �����y

y � Not signicant

Table ���� Computation of E�ects for the RISC Code Size Study

Processors Row RowWorkload RISC�I ����� Z���� ������ ����� C��� Sum Mean EE�String Search ���� ���� ���� ���� ���� ���� ����� ���� ��F�Bit Test ���� ���� ���� ���� ���� ���� ����� ���� �H�Linked List ���� ���� ���� ���� ���� ���� ����� ���� �K�Bit Matrix ���� ���� ���� ���� ���� ���� ����� ���� �I�Quick Sort ���� ���� ���� ���� ���� ���� ����� ����Ackermann���� ���� ���� ���� ���� ���� ���� ����� ���� �Recursive Qsort ���� ���� ���� ���� ���� ���� ����� ����Puzzle Subscript� ���� ���� ���� ���� ���� ���� ����� ����Puzzle Pointer� ���� ���� ���� ���� ���� ���� ����� ����SED Batch Editor� ���� ���� ���� ���� ���� ���� ����� ����Towers Hanoi ��� ���� ���� ���� ���� ���� ���� ����� ���� �Column Sum ����� ����� ����� ����� ����� ����� ������Column Mean ���� ���� ���� ���� ���� ���� ����Column E�ect ���� ����� ���� ����� ����� �����

Page 41: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ���� ANOVA Table for RISC Code Size Study

Compo� Sum of �Variation DF Mean F � F �nent Squares Square Comp� Tabley ������y�� ������y � y�� ����� ������ ��Workload ���� ����� � ���� ���� ����System ����� ������ �� ���� ������ ����Errors ���� ����� �� ����

se �pMSE �

p���� � ����

Table ����� Condence Intervals of E�ect Di�erences in the RISC Code SizeStudy

���� Z���� ������ ����� C���RISC�I ���������� �����������y ����� ����� �����������y ����� ���������� ������ ������ ������ �����y ������ ������ ������ �����yZ���� ����� ����� ����� ����� ����� ����������� �����������y ������ �����y����� ������ �����y

y � Not signicant

Page 42: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ����� Computation of E�ects for exercise ����

A Row Row RowB A� A� A� Sum Mean E�ectB� ������ ������ ������ ������� ������ �������B� ������ ������ ������� �������� ������� ������B� ������ ������ ������ ������� ������ �������B� ������ ������ ������� ������� ������� ������B� ������ ������� ������� �������� ������� ������Column Sum ������� ������� ������� ��������Column Mean ������ ������ ������� ������Column e�ect ������� ������� ������

Table ����� Interactions

B A� A� A�B� ������ ������ �������B� ������� ����� �����B� ������ ������ �������B� ������ ������� ������B� ������� ������� ������

���� The table for computing e�ects is given in table ������ The interactions aregiven in table ������ The Analysis of Variance table is given table ������The ��� condence intervals for e�ects are given in table ������ The ���condence intervals for the interactions are given in table ������ The ���condence intervals for the e�ect di�erences are given in table ������

a� Yes� All processors are signicantly di�erent from each other�

b� �����

c� All e�ects and interactions are signicant�

Page 43: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ����� ANOVA Table exercise ����

Compo� Sum of �Variation DF Mean F � F �nent Squares Square Comp� Tabley ����������y�� ����������y � y�� ���������� ������ ��A ���������� ����� � ��������� �������� ���B ��������� ����� � ��������� ������� ���Interactions ��������� ����� � �������� ������ ���Errors ������ ���� �� ����

se �pMSE �

p���� � �����

Table ����� Condence Intervals for E�ects

Para� Mean Std� Condencemeter E�ect Dev� Interval� ������ ���� ������� �������AA� ������� ���� �������� ��������A� ������� ���� �������� ��������A� ������ ���� ������� �������BB� ������� ���� �������� ��������B� ������ ���� ������� �������B� ������� ���� �������� ��������B� ������ ���� ������� �������B� ������ ���� ������� �������

Page 44: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ����� Interactions

B A� A� A�B� ������� ������� ������� ������� �������� ��������B� ���������������� ������������ ������������B� �������������� �������������� ����������������B� �������������� ���������������� ��������������B� ���������������� ���������������� ��������������

Table ����� Interactions

A� A� A�A� �������� �������� ��������� ���������A� ��������� ���������

Page 45: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� The experiment number � maximizes TI ������ so TI is high for A � ���B � ��� and E � ��� The experiment number � maximizes TB ������ so�TB is high for A � ��� B � �� and D � ���

���� The throughputs are ranked according to decreasing value of TI and it isseen that� TI is high for A � ��� B � ��� and E � ��� Similarily when thethroughputs are ranked according to decreasing value of TB it is seen that�TB is high for A � ��� B � �� and D � ���

Page 46: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� a� yt� � t � ��� Countinuous state� deterministic� dynamic� linear� andunstable

b� yt� � t� Continuous state� deterministic� dynamic� nonlinear� andunstable

c� yt � �� � yt� � "� " is not an integer� Discrete time� continuousstate� deterministic� dynamic� linear� and unstable

d� nt� �� � �nt� � � Discrete time� deterministic� dynamic� linear� andunstable

e� yt� � sinwt� Continuous time� continuous state� dynamic� nonlinear�and stable

f� �yt � �� � �yt� � " Discrete time� continuous state� probabilistic �dynamic� linear� and unstable

���� a� Since the number of factors this is best modeled by a Trace�drivensimulation�

b� The known distribution can be used to generate the events� Hence thisis best modeled by Discrete�event simulation�

c� The value of � is independent of time� Hence Monte Carlo simulationis best suited to nd the value of ��

���� The unit time approach is a time�advancing mechanism to adjust the sim�ulation clock� In this approach the time is incremeneted in small intervalsand checks are done at each increment to see if there are any events whichhave to be scheduled� This approach is generally not used� since unnecessaryincrements and checks are done during idle time�

Page 47: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� a� This is expected when the system is underloaded� Make sure that thesystem is in underloaded region

b� This is quite common when the system is overloaded� Make sure thatthe system is in overloaded region

c� This is expected�

d� This is uncommon and would require validation�

e� This is rare and would require serious validation e�ort�

���� The transient interval using the truncation method is �� since � is neitherthe maximum nor the minimum of the remaining observations� However�this is incorrect� since the actual transient interval seems to be ��

Page 48: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� This is multiplicative LCG� Hence the maximum Maximum period is �l�� ����� � �� a must be �i� �� that is � or ��� The seed must be odd�

���� The values of ��n mod �� for n � �� � � � � �� are ��� ��� ��� ��� ��� �� �� ������ ��� ��� ��� ��� �� ��� �� ��� �� ��� �� ��� ��� ��� �� �� ��� ��� ��� ��� �� Thesmallest n that results in � is ��� Yes� �� is a primitive root of ���

���� �� �� �� �

���� ����

���� x� � �������������

����

q � m div a � �� div �� � �

r � m mod a � �� mod �� � �

No� the seqence generated with and without Schrage method are di�erent�Since� q � � and r � � do not satisfy the condition r less than q�

����

q � m div a � �� div �� � �

r � m mod a � �� mod �� � �

Since� q � � and r � � do not satisfy the condition r � q� this cannot beimplemented using Schrage�s method�

��� a� Primitive

b� Primitive

c� Not primitive� Since � � x� � x���� x�� � �� x��

d� Primitive

���� a� ���

b� �� Since x� � ��x� � x� �� � x� � �

Page 49: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ����� Tausworthe method

Step� Copy seed Y� ������ ������ ������ ������ ������Step� ��bit Right shift Y� ������ ������ ������ ������ ������Step� Xor Y� � Y� � Y� ������ ������ ������ ������ ������Step� ��bit Left shift Y� ������ ������ ������ ������ ������Step� Xor� Y� � Y� � Y� ������ ������ ������ ������ ������

c� ���

d� ��� Since x�� � x�� � ��x��� �� � x��� �

���� The characteristic polynomial is x� � x � �� In this case r � �� q � �� andq � r � �� We need a ��bit right shift and ��bit left shift� The initial seed isX � �������

The sequence of calculations are show in table ������ Hence the rstve ��bit numbers are ���������� ���������� ���������� ���������� ����������

����� In both cases� the additive parameter c should be replaced by c mod m�

����� The rst �� numbers and their binary representations are listed in ta�ble ������ From the table it can be seen that the period of the lth bit is�l�

Page 50: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ����� Random Numbers Generated by the LCG xn � ��xn�� ��� mod ���

n xnDecimal Binary

� �� ��

� ��� � ���

� ���� � ����

� ������ ����� �����

� ������ ������ �����

� ���� ��� �����

� ��� �� �����

� ����� ������ �����

��� ��� ���

� ����� �� �����

�� ���� ��� �����

�� ������ ������ �����

�� ����� ����� ��

�� ����� ������ �������

�� ����� ������ �����

�� ����� ��� ����

�� ����� ���� ���

�� ������ ���� ����

� ������ ���� ��

� ������ ���� ����

Page 51: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� The nal seed value is ���������� The nal random number is ���������

Table ����� Chi�Square Test on ������ Numbers

Cell Observed Expected Observed�Expected��

Expected� ��� ������ ������ ���� ������ ������ ��� ������ ������ ��� ������ ������ ���� ������ ������ ���� ������ ������ ��� ������ ������ ��� ������ ������ ���� ������ �����

�� ���� ������ �����Total ����� ������� �����

The computed statistic is ������ The ����quantile of a chi�square variatewith nine degrees of freedom is ������ The sequence doest not passes the testat ����

���� Fifteen random numbers generated using the given LCG are �� ��� ��� ����� ��� �� �� ��� �� �� �� ��� �� ��

The normalized numbers obtained by dividing by �� are �������� ���������������� �������� �������� �������� �������� �������� �������� �������� ���������������� �������� �������� ��������

Table ����� shows a sorted list of these numbers and di�erences� Usinthe maximum values obtained from the table� K�S statistics can be computedas follows

K� �pnmaxj�j

n� xj

��p��� ������� � ������

K� �pnmaxj�xj � j � �

n

��p��� ������� � ������

K� � �������K� � ������� Both values are less thanK����������������The sequence passes the test�

Page 52: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ����� Computation for the K�S Test

j xjjn� xj xj � j��

n

� ������� ������� �������� ������� ������� �������� ������� ������� �������� ������� ������� �������� ������� ������� �������� ������� ������� �������� ������� ������� �������� ������� ������� �������� ������� ������� �������

�� ������� ������� ��������� ������� ������� ��������� ������� ������� ��������� ������� ������� ��������� ������� ������� ��������� ������� ������� �������

Max ������� �������

Table ����� Autocovariances for the Random Sequence for exercise ����

Lag Autocovariance St� Dev� ��� Condence Intervalk Rk of Rk Lower Limit Upper Limit� ��������� �������� ��������� ���������

p� �������� �������� ��������� ��������� ��������� �������� ��������� ��������� ��������� �������� ��������� ��������� �������� �������� �������� ��������

p� ��������� �������� ��������� ��������� �������� �������� ��������� ��������� �������� �������� ��������� ��������� ��������� �������� ��������� ���������

p�� �������� �������� ��������� ��������

Page 53: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� The autocovariance and condence intervals for the serial autocovariancesat lags � to �� are given in table ������ Three autocovariance at lag �� �� ��are signicant�

���� The pairs generated by the rst generator lie on the following two lines witha positive slope

xn ��

�xn�� �

��

�k� k � �� �

The distance between the lines is ���p�� The pairs generated by the second

generator lie on the following two lines with a negative slope

xn � ��xn�� � ��k� k � �� �

The distance between the lines is ���p�� Both generators have the same

��distributivity�

Page 54: Art of computer systems performance analysis techniques for experimental design measuremet

��

��� a� Inverse transformation Generate u � U�� ��� If u � ���� then x �p�u� otherwise x � ��

q��� u��

b� Rejection Generate x � U�� �� and y � U�� ��� If y � minx� �� x��then output x� otherwise repeat with another pair�

c� Composition The pdf fx� can be expressed as a weighted sum of aleft triangular density and a right triangular density�

d� Convolution Generate u� � U�� �� and u� � U�� ��� Return u� � u��

Page 55: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� a� Geometric� Geometric distribution is used to model number of at�tempts between successive failures�

b� Negative binomial� It can be used model the numberof failures beforethe mth success�

c� Logistic� � xxx�

d� Normal� The mean of large set of uniform distribution is a normaldistribution�

e� Lognormal� The product of large set of uniform is a lognormal distri�bution�

f� Pareto� This is used t power curves�

g� Poisson� Sum of two Poisson�s is a Poisson distribution�

h� Chi square� Variances of normal population has chi�square distribution�

i� F � Ratio of variances of normal population has F distribution�

j� Exponential� Exponential is used to model memoryless events�

k� Erlang�m� Sum m memoryless servers can be represented by Erlang�mdistribution��

l� Binomial� This models the successes in n independent and identicalBernoulli trails�

m� Beta� This is used to model ratio of random�variates�

���� a� Sum of normal distribution is normal� � � ��� � ��� �q��� � ��

Hence it is a N�� �� distribution� ��� quantile is ����� from appendixtable A��

b� Sum of variances is chi�square distribution� There are � normal variates�hence it is a ��� distribution� ��� quantile is ����� from appendixA���

Page 56: Art of computer systems performance analysis techniques for experimental design measuremet

��

c� Ratio of two chi�square variates is a F distribution� Since both numer�ator and denominator have two variates the degrees of freedom is � forboth� Hence it is a F �� �� distribution� ��� quantile is ���� fromappendix A���

d� Ratio of normal to square root of chi�square distribution is a t distinc�tion� Number of degrees of freedom is �� Hence it is a t�� distribution���� is ����� from appendix A���

Page 57: Art of computer systems performance analysis techniques for experimental design measuremet

��

��� Erlang�k arrivals� general bulk service� ve servers� ��� waiting positions����� population size� and last come rst served preemptive resume service�

��� Because it provides �� waiting positions for a population of only �� Also�since there are �� servers and only �� waiting positions� two servers have nowaiting positions�

��� Both will provide the same performance� Increasing bu�ers beyond thepopulation size has no e�ect�

��� E�n� � �E�r� � �����

� ��� �� Job �ow balance was assumed� Service time

distribution has no e�ect�

��� If k � � then Ek becomes a exponential distribution� Hence Ek�M�� can becalled a Poisson process if k � ��

Page 58: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� a� The probability pn for birth�death processes is given by

pn ���� �n��

���� �n p� n � �� �� � � � �

Here �n � �n��

and �n � �� Therefore

pn � n

n�p�where �

b� The sum of the probabilities should be �� Therefore�

p ��

� �P�

n��n

n

p � e��

c�

E�n� ��Xn��

npn � p�Xn��

n n

n�

E�n� � e�� e� �

d� �� � ���� e���

e� E�r� � E�n���

� ��

���e���

���� a� The probability pn for birth�death processes is given by

pn ���� �n��

���� �n p� n � �� �� � � � �

Here �n � � and �n � n�� Therefore

pn � n

n�p�where �

b� p � e�� derivation is similar to previous exercise solution�

c� E�n� �

Page 59: Art of computer systems performance analysis techniques for experimental design measuremet

��

d� Var�n� � E�n��� E�n��� �P�

n�� n� �n

n p � � � e�� � ��e� � �

Var�n� �

e� E�r� � E�n��

� ��

���� a� � ����� � ���b� E�s� � ��� � E�r��� � � ��� ���� � ��� � ��� secondc� � � � � ����� ������� � ��� queries per minute

d� E�n� � ���� � ���

������ �

e� P n � ��� � �� � ������ � �����f� r� � E�r� ln���� � ��� secondsg� w� � E�r� ln��� � � ���� seconds

���� a� � �m�

� ��������

� ���b� p � ����

c� � � ������

� ��������� � ����

d� E�n� � � � ��� � ���� ������� ���� � ����e� E�nq� � ���� ������� ���� � ����

f� E�r� � ��

�� � ���

������

�� ������ second

g� Var�r� � ������� second� use forumla �� of Box �����h� w� � ������ second use formula �� of Box �����

���� a� � � ���� � ��� � ���������� � ���b� p � � ����c� � � ����d� E�n� � ��

����� � request per drive

e� E�nq� ����

����� ��� request per drive

f� E�r� � �������

� ��� secondg� Var�r� � E�r��� � ���� ��� � ���� second�

h� w� � ���� second use formula �� of Box �����

���� Yes� With the new system� the ���percentile of the waiting time will be zero�

���� Yes� since with � � ������� � ������� average waiting time is ���� minutesand the ���percentile of waiting time is zero�

Page 60: Art of computer systems performance analysis techniques for experimental design measuremet

��

��� a� p � ���� use formula � of Box �����p� � ����� p� � ����� p� � ����� p� � ������ use formula � of Box �����b� E�n� � ��� requests use formula � of Box �����c� E�nq� � ������ requests use formula � of Box �����d� Var�n� � �� � p� � �� � p� � �� � p� � �� � p� � ����� � ���e� �� � ��� pB� � ���� ������� � �� requests per secondf� Loss rate� �pB � ��� ������ � ��� requests per secondg� U � �� pB� � ����� ������� � ����h� E�r� � E�n���� � ������ � ������ second

���� The probability pn for birth�death processes is given by

pn ���� �n��

���� �n p� n � �� �� � � � �

pn �

�����������

pm �n

�Kn

�� � n � m

p n

�Kn

�n m mm m � n � K

where � �m�

Average throughput �� �PK��

n� K � n��pn � �K � E�n��U � ��

m�� K � E�n��

E�r� � E�n���

� E�n��K�E�n��

���� pn �

�����������

�Kn

�m �np � � n � m�

Kn

�n ��nmm

m p m � n � B

where� � �m�

Average throughput �� �PB

n�K � n��pn � � K � E�n�� K � B�pB�where pB is the probability of B jobs in the system�U � ��

m�� K � E�n�� K �B�pB�

E�r� � E�n���

� E�n��K�E�n��K�B�pB�

Page 61: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� a� Job �ow balance� Number of job arrivals is not equal to number ofdepartures since some jobs are lost�

b� Fair service

c� Single resource possession

d� Routing homogeneity

e� No blocking

f� Single resource possession

g� One�step behavior

Page 62: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� X����������� S������� U � XS�����������

���� n��� X��� n � XR � R���� second�

���� X��������� Vdisk���Xdisk � XVdisk��� Sdisk������� Udisk � XdiskSdisk��� ���� � ���� � ���

���� Xprinter����������� Vprinter��� X � Xprinter�Vprinter� ���� � ��

jobs�minute

���� a� VCPU � ������ � ��� VA � �������� � ��� VB � ��������� � ��b� DCPU����� � �� � �� DA����� � �� � ���� DB� ������� � ���c� Uk � XDk � X����������� UCPU��� UB����d� Uk � XDk � X����������� R � N�X � Z � ����� � � �� seconds

���� xxx The data used here looks like that from problem ����� a� CPU sinceit has the most demand�b� Rmin � D� �D� �D� � ��������� � ���c� X � �� U� � �� ��� � ���d� Dmax��� Uk � XDk � X � � job�seconde� R � maxfD�NDmax � Zg � Dmax � R�Z

N� ���� We need at least a

��� faster CPU� disk A would be just OK�f� D����� Dmax��� Z��� � X � minf N

���� �g� R � maxf���� N � �g

���� a� D������D� � ����D� � ��� � disk Ab� D������ D������D� � ��� � disk Ac� D����D� � ����D����� � CPUd� D����D� � ����D��� � disk B

Page 63: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� X � ��� D� � �� D� � �� � ���� � ���� D� � � � ���� � ���� Qi �Ui�� � Ui� � XDi�� � XDi�� Q� � ��� � ��� � ��� � �� � �� Q� ���� � ����� � ����� � ������ Q� � ��� � ����� � ����� � ����� Qavg �P

iQi � � � ����� � ����� � �����Ri � Si���Ui� � Si���XDi�� R� � ������� ���� � ���� R� � ������������ � ������� R� � ������������� � ������� Ravg �

PRiVi � �������

������� �� � ������� � � ������ seconds�

���� xxx depends on data of ���� which is wrong��

Response Time System Queue LengthsN CPU Disk A Disk B System Throughput CPU Disk A Disk B� ����� ����� ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ����� ����� �����

���� xxx depends on data of ���� which is wrong��

Itera� Response Time System Queue Lengthstion No� CPU Disk A Disk B System Throughput CPU Disk A Disk B

� ����� ����� ����� ������ ����� ����� ����� ������ ����� ����� ����� ������ ����� ������ ����� ������ ����� ����� ����� ������ ����� ������ ����� ������ ����� ����� ����� ������ ����� ������ ����� ������ ����� ����� ����� ������ ����� ������ ����� �����

���� Each packet is serviced by the � computers� Hence the throughput is whenthere is one packet is X� � ���S� The packet spents a time of S in each hopso the response time is R� � �S� SimiliarilyX� � ���S� R� � �SX� � ���S� R� � �SX� � ���S� R� � �SX� � ���S� R� � �SIn general R � n � ��S� X � n

n���S� n � �

���� If there are h hops in the network� then the each packet has to get servicedby h hops and has to wait a time of nS hops before getting serviced� Hence�

Page 64: Art of computer systems performance analysis techniques for experimental design measuremet

��

the response time is R � n � h�S� Arguing similarily the throughput isX � n

n�h�S� Power X�R � n

n�h��S� is maximum when n�h����n�h�n ��� n � h

���� xxx depends on data of ���� which is wrong��The balanced job bounds are

N

� � ��� � N � ������ ���N������N�����

� XN� � min

��

N

� � ��� � N � �� ��������

max�N � �� ��� � N � ��

���

��� � �

�� RN� � ����N�������

N � �����

N � ����� � �

Response Time ThroughputLower Upper Lower Upper

N BJB MVA BJB BJB MVA BJB� ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� ������ ����� ����� ����� ����� ����� �����

�� ����� ����� ����� ����� ����� �����

���� a� X � ND��N��

M�� NM

DM�N���� R � Q�X � N�X � DM�N���

M

b� Substituting Davg � Dmax � D�M and Z � � in Equations �����and ������ we get the same expressions as in Exercise ���� for balancedjob bounds�

Page 65: Art of computer systems performance analysis techniques for experimental design measuremet

��

Table ����� Computing the Normalizing Constant for Exercise ����

n yCPU � �� yA � � yB � �� � � �� �� �� ��� ��� ��� ���� ���� ���� ����

���� DCPU � ����� �� � �� DA � ����� �� � ���� DB � ������ � � ���� Forscaling factor choose � ����� � ��� This results in yCPU � ��� yA � ��yB���

The probability of exactly j jobs at the ith device is

P ni � j� � P ni � j�� P ni � j � ��

�yji

GN�GN � j�� yiGN � j � ���

P QCPU � �jN � �� ��

��������� ��� ���� � �����

P QCPU � �jN � �� ���

�������� ��� ��� � �����

P QCPU � �jN � �� ����

������� ��� �� � �����

P QCPU � �jN � �� �����

������ ��� �� � �����

xxx the book answer is di�erent� P QCPU � njN � �� for n � �� ���� � are ������ ������ ������ and ������ respectively���

The throughputs for N � �� �� � are

X�� � GN � ��

GN�� ��� �������� � �����

X�� � ��G��

G��� ��� ������ � �����

X�� � ��G��

G��� ��� ���� � �����

xxx in book are di�erent�

Page 66: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� xxx data in ���� is wrong�� P QCPU � njN � �� for n � �� �� �� � are������ ������ ������ and ������ respectively�

Page 67: Art of computer systems performance analysis techniques for experimental design measuremet

��

���� xxx answer depends on data of Exercise ����� X � ������ ������ and �����for N � �� �� �� respectively� R � ������ ������ ����� for N � �� �� ��respectively�

���� xxx answer depends on data of Exercise ����� The service rates of the FECare ������ ������ and ������ respectively� for one through three jobs at theservice center�