f b fbddf flf - kasetsart universitymcs/courses/2008_01/214571/slides/ch6... · a large...

26
Prof. Daniel A. Menascé Department of Computer Science George Mason University www.cs.gmu.edu/faculty/menasce.html 1 © 2004 D. A. Menascé. All Rights Reserved. f f f Most of the figures in this set of slides come from the book “Performance by Design: l b l b computer capacity planning by example,” by Menascé, Almeida, and Dowdy, Prentice Hall, l f b dd 2004. It is strictly forbidden to copy, post on a Web site, or distribute electronically, in part l fh ld h fl or entirely, any of theslides in this file. 2 © 2004 D. A. Menascé. All Rights Reserved.

Upload: dinhliem

Post on 04-Mar-2018

213 views

Category:

Documents


1 download

TRANSCRIPT

Prof. Daniel A. MenascéDepartment of Computer ScienceGeorge Mason Universityg ywww.cs.gmu.edu/faculty/menasce.html

1© 2004 D. A. Menascé. All Rights Reserved.

f f fMost of the figures in this set of slides come from the book “Performance by Design: 

l b l bcomputer capacity planning by example,” by Menascé, Almeida, and Dowdy, Prentice Hall, 

l f b dd2004. It is strictly forbidden to copy, post on a Web site, or distribute electronically, in part 

l f h l d h f lor entirely, any of the slides in this file.

2© 2004 D. A. Menascé. All Rights Reserved.

A large compan   ses an internal Web ser er to A large company uses an internal Web server to allow its programmers, testers, and documentation personnel to download two types of files: 

PDF files containing documents and manualsZIP files containing software files.

The server has one CPU and 4 identical disks.4PDF files are stored on disks 1 and 2 (with evenly distributed access)ZIP files are stored in disks 3 and 4 (with evenly ZIP files are stored in disks 3 and 4 (with evenly distributed access)

3© 2004 D. A. Menascé. All Rights Reserved.

© 2004 D. A. Menascé. All Rights Reserved. 4

fHow many PDF and ZIP file downloads can be sustained concurrently with given response times?What is the impact of using Secure Sockets 

f d l dLayer (SSL) for secure downloads?

5© 2004 D. A. Menascé. All Rights Reserved.

Elapsed Time File Type Size (KB) (sec)PDF 303 1.43ZIP 1233 5 81ZIP 1233 5.81ZIP 1077 5.08PDF 315 1.48ZIP 1240 5.84PDF 413 1.95ZIP 1139 5.37ZIP 1139 5.37ZIP 1198 5.64PDF 323 1.52ZIP 1188 5 60

. . . . . . . . . . . . . ZIP 1188 5.60

6© 2004 D. A. Menascé. All Rights Reserved.

Cpdf = 43 1 KB / 377 6 KB = 0 114 < 0 25 single class

© 2004 D. A. Menascé. All Rights Reserved. 7

Cpdf = 43.1 KB / 377.6 KB = 0.114 < 0.25 single class

l d d dKnown population standard deviation.Unknown population standard deviation: 

Large samples (≥30): sample standard deviation is a good estimate for population t d d d i ti  OK t     l standard deviation. OK to use normal distribution: use z distribution

Small samples and original variable is normally Small samples and original variable is normally distributed: use t distribution with n‐1 degrees of freedom.of freedom.

8© 2004 D. A. Menascé. All Rights Reserved.

αμ −=≤≤ 1]Pr[ 21 cc

(c1,c2): confidence interval( 1 2)α: significance level (e.g., 0.05)(1 – α): confidence coefficient (e.g., 0.95)) g100(1 – α): confidence level (e.g., 95%)

9© 2004 D. A. Menascé. All Rights Reserved.

μ

Sample Interval include μ?1 YES2 YES2 YES3 NO…100 YES100 YES

100 (1 α) of the 100 samples include the population mean μ

10

100 (1 – α) of the 100 samples include the population mean μ.

© 2004 D. A. Menascé. All Rights Reserved.

If th   b ti  i     l    i d d t  d If the observations in a sample are independent and come from the same population that has mean μand standard deviation σ then the sample mean for plarge samples has a  normal distribution with mean μ and standard deviation σ/ .

)/(n

The standard deviation of the sample mean is called 

)/,(~ nNx σμp

the standard error.

11© 2004 D. A. Menascé. All Rights Reserved.

)/,( nN σμ

μc2=Q(1-α/2)c1=Q(α/2)c2=Q(1-α/2)

Q( /2) )/( nN σμ

μ

1-α

c1 Q(α/2)c1=Q(α/2) )/,( nN σμ

c1 c2

α/2α/20

(1 – α/2)-quantile of standard

x2=z 1-α/2

N(0,1)

(1 α/2) quantile of standardnormal distribution

1-αα/2α/2

2 1 α/2

x1=z α/2 = - z 1-α/2

x1 x20

2/12 ασμ −+= zn

c

12

2/12/1 αασμσμ −−=+= zn

zn

c

• 100 (1-α)% confidence interval for the population mean:

),( 2/12/1n

szx

n

szx αα −− +−

nn

: sample meanx ps: sample standard deviationn: sample size

: (1 α/2) quantile of a unit normal variate (N(0 1))z : (1 – α/2)-quantile of a unit normal variate (N(0,1)).2/1 α−z

13© 2004 D. A. Menascé. All Rights Reserved.

• 100 (1-α)% confidence interval for the population mean:

),( ]1;2/1[]1;2/1[n

stx

n

stx nn −−−− +− αα

nn

: sample meanx ps: sample standard deviationn: sample size

: critical value of the t distribution with n 1 degrees of]12/1[t : critical value of the t distribution with n-1 degrees of freedom for an area of α/2 for the upper tail.

]1;2/1[ −− nt α

14© 2004 D. A. Menascé. All Rights Reserved.

= (1-α/2)-quantile of a unit normal variate (N(0, 1)):= NORMINV (1-α/2,0,1) = NORMSINV(1- α/2)

H lf i t l CONFIDENCE ( )

2/1 α−z

Half-interval = CONFIDENCE (α, σ, n)

]12/1[t (1 /2) til f t i t ith 1 d f]1;2/1[ −− nt α = (1-α/2)-quantile of t-variate with n-1 degrees of freedom = TINV(α, n-1)

15© 2004 D. A. Menascé. All Rights Reserved.

Czip = 85 7 KB / 1155 6 KB = 0 074 < 0 25 single class

© 2004 D. A. Menascé. All Rights Reserved. 16

Czip = 85.7 KB / 1155.6 KB = 0.074 < 0.25 single class

From our goal of determining the max no. of PDF g gand ZIP concurrent downloads while still meeting a given SLA, a closed multiclass QN model is used.To complete parameterization of the model, To complete parameterization of the model, concurrency level for each class (file type) and service demands at each device are needed.Computing concurrency levels:Computing concurrency levels:

From Section 5.7.4, the average concurrency level,       , of class r jobs can be estimated as:

n∑

rN

h   i   h   l d  i   f j b i f  l     d

,1

n

i rir

eN

τ== ∑

where ei, r is the elapsed time of job i of class r, andτ is the measurement interval

© 2004 D. A. Menascé. All Rights Reserved.17

hThen,411

,1 731.5

3 7 4i pdf

i

eN == = = ≈

589

,

3.7 4interval duration 200

3207 7

pdf

i zip

N

e

= = = ≈

∑1 3207.7

16.1 16interval duration 200

izipN == = = ≈

Will use a ratio of 1:4 for PDF to ZIP file downloads

© 2004 D. A. Menascé. All Rights Reserved. 18

dComputing Service Demands

Service demands depend on file sizes

Experiments conducted  on a similar Web server machine with 1 CPU and 1 disk

A set of n dummy files with files sizes of 10 KB  100 A set of n dummy files with files sizes of 10 KB, 100 KB, 200 KB, 500 KB, 800 KB, and 1000 KB are used.

For each file size  the n files are downloaded while For each file size, the n files are downloaded while measuring the CPU and disk utilization of the test server.

Service demand = utilization/(n / interval)

© 2004 D. A. Menascé. All Rights Reserved. 19

© 2004 D. A. Menascé. All Rights Reserved. 20

© 2004 D. A. Menascé. All Rights Reserved. 21

msec1.77)2919.06.3774078.0(5.0

msec4.390604.06.3771046.0

,2,1

,

=+××==

=−×=

pdfdiskpdfdisk

pdfCPU

DD

D

msec8.1200604.06.11551046.0

0

,

,4,3

=−×=

==

zipCPU

pdfdiskpdfdisk

D

DD

0

msec8.235)2919.06.11554078.0(5.0

21

,4,3

==

=+××==

zipdiskzipdisk

zipdiskzipdisk

p

DD

DD

,2,1 zipdiskzipdisk

22© 2004 D. A. Menascé. All Rights Reserved.

Service Demands (sec)CPU 0.0394 0.1208Disk 1 (PDF) 0.0771 0.0000Disk 2 (PDF) 0.0771 0.0000Disk 3 (ZIP) 0.0000 0.2358Disk 4 (ZIP) 0.0000 0.2358

Closed QN:• two classes: PDF and ZIP.

t l ti ti 1 4

23

• customer population ratio: 1:4

© 2004 D. A. Menascé. All Rights Reserved.

Evenly distribute both file types to all 4 disks

Service Demands (sec)CPU 0 0394 0 1208CPU 0.0394 0.1208Disk 1 (PDF) 0.0386 0.1179Disk 2 (PDF) 0.0386 0.1179Disk 3 (ZIP) 0.0386 0.1179Disk 4 (ZIP) 0.0386 0.1179

24© 2004 D. A. Menascé. All Rights Reserved.

14

10

12se

c)

8

10

do

wn

load

s/s

4

6

hro

ug

hp

ut

(d

2

Th

0

0 20 40 60 80 100 120 140 160 180

Total Number of Concurrent Users

PDF O i Fil Di t ZIP O i Fil Di t

© 2004 D. A. Menascé. All Rights Reserved. 25

PDF - Orig. File Distr. ZIP - Orig. File Distr.PDF - Balanced File Distr. ZIP - Balanced File Distrib.

After some point (after 20 users)  throughput saturates because After some point (after 20 users), throughput saturates because utilization of one of the Web server devices (disks 3 & 4) approaches 100%Max throughput for PDF in original config is 12 files/sec. however, g g gfor balanced config, max throughput for PDF is reduced to 5 files/sec.Max throughput for ZIP in original config is 4.2 files/sec. however, for balanced config, max throughput for ZIP is increased to 6 6 for balanced config, max throughput for ZIP is increased to 6.6 files/sec.Total throughput measured for both PDF and ZIP is reduced by 28% from 16.2 (=12+4.2) to 11.6 (5+6.6). However, since ZIP files are much larger than PDF files  total throughput measured in are much larger than PDF files, total throughput measured in bandwidth (KB/sec) increases by 1.4%, from 9384.72 (=12x377.6+4.2x1155.6) KB/sec to 9514.96 (=5x377.6+6.6x1155.6) KB/sec

© 2004 D. A. Menascé. All Rights Reserved. 26

40

S f

30

35

sec)

SLA for Response Times:• PDF: 7 seconds• ZIP: 20 seconds

20

25

nlo

ad T

ime

(s

10

15

0

vera

ge

Do

wn

104 customers

164 customers

5

10

Av

0

0 20 40 60 80 100 120 140 160 180

Total Number of Concurrent Customers

PDF O i Fil Di t ZIP O i Fil Di t

© 2004 D. A. Menascé. All Rights Reserved. 27

PDF - Orig. File Distr. ZIP - Orig. File Distr.PDF - Balanced File Distr. ZIP - Balanced File Distr.

After about 20 concurrent users  throughput saturates After about 20 concurrent users, throughput saturates for all classes, and so download times increase linearly with no. of concurrent users.F     t     d l d ti  f  For 104 concurrent users, average download times for ZIP at original config reaches its SLA of 20 secs, while download times for PDF is far below its SLA of 7 secs. Th       f  t d l d   t d b  Thus, max no. of concurrent downloads supported by original config is 104.For balanced config, average download time for ZIP 

h     t  6   t    hil  reaches 20 secs at 164 concurrent users, while download times for PDF is still below 7‐sec SLA. Thus, balanced config supports 58% more users than the i i l original one.

© 2004 D. A. Menascé. All Rights Reserved. 28

f fUse of Secure Sockets Layer (SSL) for user authentication and data integrity and 

f d lconfidentiality.SSL has a handshake phase during which 

bl k d hpublic key encryption is used to exchange secrets used to generate a symmetric key.h k h d f dThe symmetric key is then used for data 

exchange in the second phase.

29© 2004 D. A. Menascé. All Rights Reserved.

30© 2004 D. A. Menascé. All Rights Reserved.

31© 2004 D. A. Menascé. All Rights Reserved.

fPublic Key (PK) cryptography is order of magnitudes slower than symmetric key 

hcryptography.

encrypting a 128‐byte block using a public key of 512 bits takes 3.5 msec on a Pentium‐II 266 MHz while symmetric key encryption using AES would take less than one microsecond on the same take less than one microsecond on the same machine. 

32© 2004 D. A. Menascé. All Rights Reserved.

Symmetric key cryptography is not scalable to a large number of users: they are required 

h kto share a secret key.It is faster to encrypt with a public key than to d h kdecrypt with a secret key.

33© 2004 D. A. Menascé. All Rights Reserved.

MessageMessageDigest 101…1010g

FunctionLarge

Small(e g 128 bits)Large (e.g., 128 bits)

34© 2004 D. A. Menascé. All Rights Reserved.

A Digest AMessageDigest

g

gFunction

B Digest B

If A B Di t A Di t B35

If A =B => Digest A = Digest B© 2004 D. A. Menascé. All Rights Reserved.

?MessageDigest Digest Ag

Functiong

36

Extremely hard to get A from Digest A!© 2004 D. A. Menascé. All Rights Reserved.

fMessage digest generation is a fast operation. For example, the hash generation 

f l k l brate of SHA‐1 is 13 clock cycles per byte on a Pentium machine. So, a digest of a 1‐Mbyte f l ld b d lfile would be generated in approximately 13 msec on a 1 GHz Pentium machine. 

37© 2004 D. A. Menascé. All Rights Reserved.

38© 2004 D. A. Menascé. All Rights Reserved.

HTTP

S SSL H d h k• selection of cryptographicalgorithmS

SSSL Handshake

Protocolalgorithm

• mutual authentication• exchange of secrets

through PKL

SSL RecordProtocol

• compression/decompression• encryption/decryption

through PK

TCP

Protocol • message authentication

39© 2004 D. A. Menascé. All Rights Reserved.

40© 2004 D. A. Menascé. All Rights Reserved.

41© 2004 D. A. Menascé. All Rights Reserved.

42© 2004 D. A. Menascé. All Rights Reserved.

(Client random number session id cypher suites)

43

(Client random number, session id, cypher suites)

© 2004 D. A. Menascé. All Rights Reserved.

(X 509 Certificate server random number server session ID cypher suites)

44

(X.509 Certificate, server random number, server session ID, cypher suites)

© 2004 D. A. Menascé. All Rights Reserved.

(master secret key encrypted with server’s public key)

45

(master secret key encrypted with server s public key)

© 2004 D. A. Menascé. All Rights Reserved.

(digest of all messages sent by client encrypted with bulk encryption key)

46

(digest of all messages sent by client encrypted with bulk encryption key)

© 2004 D. A. Menascé. All Rights Reserved.

Handshake CPU Processing Time (msec)

gTime per KB (msec)

Low Security 10.2 0.104Medium Security 23.8 0.268Hi h S it 48 0 0 609High Security 48.0 0.609

Levels of security depend on key lengths and on the strength of the security algorithms usedstrength of the security algorithms used.

Additional Service Demands (sec) for Secure Download

49.5 ms = 10.2 + 0.104 * 377.6

PDF ZIPLow Security 0.0495 0.1304Medium Security 0.1250 0.3333Medium Security 0.1250 0.3333High Security 0.2781 0.7519

47© 2004 D. A. Menascé. All Rights Reserved.

No. Concurrent X_PDF X_ZIP R_PDF R_ZIPDownloads (files/sec) (files/sec) sec sec

20 2.25 3.15 1.78 5.09Low Security

40 2.26 3.17 3.55 10.0860 2.25 3.18 5.32 15.1080 2.25 3.18 7.10 20.12

20 1.22 1.75 3.28 9.1340 1.22 1.76 6.56 18.1960 1 22 1 6 9 8 2 2

Medium Security

60 1.22 1.76 9.85 27.27

20 0.63 0.91 6.34 17.49High Security

40 0.63 0.92 12.69 34.93

48© 2004 D. A. Menascé. All Rights Reserved.

Factors that affect  Factor LevelsFactors that affect performance: processor speed, 

Factor Levels

Processor Speed

2.0, 2.4, 2 8 3 1

p p ,number of processors, and main memory.

l l f

Speed (GHz)

2.8, 3.1

No 1 2 4 8Levels: values of a factor.

No. processors

1, 2, 4, 8

Main 1 2 4Main memory (GB)

1, 2, 4

(GB)

49© 2004 D. A. Menascé. All Rights Reserved.

Select a representative Elapsed Time (sec)

Elapsed Time Select a representative 

workload and apply it to the two servers and 

Type Size (KB)

( )Original Server

(sec) New Server

New-Original

PDF 300 1.42 1.39 -0.03PDF 301 1.42 1.38 -0.04PDF 301 1.42 1.38 -0.03

measure the download times in each case.

h

PDF 301 1.42 1.38 0.03PDF 301 1.42 1.38 -0.04PDF 302 1.42 1.41 -0.01PDF 302 1.42 1.42 0.00PDF 302 1.42 1.38 -0.04

Compute the difference between the download times

ZIP 1000 4.71 4.71 -0.01ZIP 1001 4.72 4.58 -0.14ZIP 1002 4.72 4.59 -0.13ZIP 1004 4.73 4.60 -0.13

. . . . . . . . . . . . . .

download times. ZIP 1005 4.73 4.55 -0.18ZIP 1005 4.73 4.71 -0.02ZIP 1005 4.74 4.62 -0.12ZIP 1005 4.74 4.58 -0.15ZIP 1006 4.74 4.58 -0.16ZIP 1007 4.75 4.62 -0.13

50© 2004 D. A. Menascé. All Rights Reserved.

Compute the 95% Difference (new-orig) for PDF Files:Mean -0 0357Compute the 95% 

confidence interval for the average difference between the download 

Mean -0.0357Standard Deviation 0.0235Lower bound 95% CI Difference -0.0380Upper bound 95% CI Difference -0.0334

between the download times.If the 95% confidence 

Difference (new-orig) for ZIP Files:Mean -0.1109Standard Deviation 0.0631Lower bound 95% CI Difference -0.1160

interval for the average difference contains zero, then the two servers are 

Lower bound 95% CI Difference 0.1160Upper bound 95% CI Difference -0.1058

then the two servers are statistically identical at the 95% confidence level.

The new server outperforms theoriginal server for both PDF andZIP files at the 95% confidence level

51

level.