27
Challenge the future Delft University of Technology Operational Laws IN4390 Quantitative Evaluation of Embedded Systems Koen Langendoen

Operational Laws - TU Delft

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Operational Laws - TU Delft

Challenge the future

DelftUniversity ofTechnology

Operational Laws

IN4390 Quantitative Evaluation of Embedded SystemsKoen Langendoen

Page 2: Operational Laws - TU Delft

2IN4390

Queueing theoryYet another take at performance evaluation

•Measurements DoE

•Simulations…

•Modeling Petri nets

Markov modeling

Queueing theory

memorylessmakes for easy math

Page 3: Operational Laws - TU Delft

3IN4390

Queues are everywhere

• impacts response time

• signals bottleneck(s)

When demand exceeds supply

Black Friday

Page 4: Operational Laws - TU Delft

4IN4390

A queue

Characterized by

• arrival distribution (rate)

• request size (service time)

• scheduling discipline

serverarriving requests

completing requests

Page 5: Operational Laws - TU Delft

5IN4390

A queueing system

Characterized by A/S/m/B/K/SD

• A: interarrival time distr.

• S: service time distr.

• m: #servers

• B: #buffers

serverarriving requests

completing requests

Kendall notation

• K: population size

• SD: Service Discipline

M | E | D | ... | G

Page 6: Operational Laws - TU Delft

6IN4390

A queueing system

Characterized by A/S/m/∞/∞/FCFS

• A: interarrival time distr.

• S: service time distr.

• m: #servers

serverarriving requests

completing requests

Kendall for dummies

M | E | D | ... | G

Page 7: Operational Laws - TU Delft

7IN4390

Operational laws

•Operational directly measurable

•Testable assumptions#arrivals = #completions [job flow balance]

•Observable variablesarrival rateservice timewaiting time...

Hold for any distributions and scheduling

what happenswhen violated?

= randomvariable?

operational law =relation between observables

Page 8: Operational Laws - TU Delft

8IN4390

Operational quantities

•Measure during a time period tA: #arrivals

C: #completions

B: busy time

•Derive mean valuesarrival rate: = A / t

throughput: X = C / t

utilization: U = B / t

service time: S = B / C

service rate = 1 / S

Any system

(device)

Arrivals Departures

large orsmall?

Page 9: Operational Laws - TU Delft

9IN4390

Operational laws

Good for

• "back of the envelope" calculations

•determining performance bounds

UTILIZATION LAW U = X S

LITTLE'S LAW N = X R

FORCED FLOW LAW Xk = Vk X

BOTTLENECK LAW Uk = Dk X

Page 10: Operational Laws - TU Delft

10IN4390

System model

•Openexternal arrivals

e.g. web server

•Closedfixed number of jobs

e.g. thread pool

e.g. time-sharing system

Any

system

Arrivals (𝜆 rate)

Departures

Any

system

X(throughput) Departures

Page 11: Operational Laws - TU Delft

11IN4390

U = S

Utilization law

•Open

•Closed

Any

system

Arrivals (𝜆 rate)

Departures

Any

system

X(throughput) Departures

U = X S

implicitassumption?

Page 12: Operational Laws - TU Delft

12IN4390

Little’s law

•Open

•Closed

N: #jobs in the system

R: Response time

Z: think time

Any

system

Arrivals (𝜆 rate)

Departures

Any

system

X(throughput) Departures

N = X R

N = X (R+Z)

how toproof?

mean

values

Page 13: Operational Laws - TU Delft

13IN4390

Little’s lawProof sketch

• J = hatched area = total time spent in the system by all jobs

• X = A/t

• N = J/t vertical view

• R = J/C horizontal view

• N = X R Little’s Law

Page 14: Operational Laws - TU Delft

14IN4390

Little’s law

N = R X

Cheers!

Page 15: Operational Laws - TU Delft

23IN4390

Operational laws

Good for

• "back of the envelope" calculations

•determining performance bounds

UTILIZATION LAW U = X S

LITTLE'S LAW N = X R

FORCED FLOW LAW Xk = Vk X

BOTTLENECK LAW Uk = Dk X

Page 16: Operational Laws - TU Delft

24IN4390

Systems of systems

•Multiple resources

•Connected queues

•Operational laws apply individual queues

system as a whole

number devices (1 .. #resources)

top-level system is device 0

Nk = Xk Rk

N0 = X0 (R0+Z)

Page 17: Operational Laws - TU Delft

25IN4390

Forced Flow law

•Relate system throughput

• to device throughput

Vk: #visits to device k per job

•Proof by counting

Xk = 𝐶𝑘𝑡

= 𝐶𝑘𝐶0

𝐶0𝑡

= Vk X

Xk = Vk X

any intuition?

Page 18: Operational Laws - TU Delft

26IN4390

Example

Suppose a system has:

• 30 terminals

• 18 seconds average think time

• 20 visits to a specific disk/interaction

• 30% utilization of that disk

• 25 ms is the average time for a disk access

Compute the system throughput and response time.

What one rattling disk reveals

N = 30Z = 18Vdisk = 20Udisk = 0.30Sdisk = 25 ms

Page 19: Operational Laws - TU Delft

27IN4390

Example

Compute the

• system throughput

• response time

Solution:

• Xdisk = Udisk / Sdisk = 0.3 / 0.025 = 12 req/s

• X = Xdisk / Vdisk = 12 / 20 = 0.6 interactions/s

• N = X (R+Z) → R = N/X – Z = 30/0.6 – 18 = 50–18 = 32

What one rattling disk reveals

N = 30Z = 18Vdisk = 20Udisk = 0.30Sdisk = 25 msXk = Vk X

Page 20: Operational Laws - TU Delft

29IN4390

Operational laws

Good for

• "back of the envelope" calculations

•determining performance bounds

UTILIZATION LAW U = X S

LITTLE'S LAW N = X R

FORCED FLOW LAW Xk = Vk X

BOTTLENECK LAW Uk = Dk X

Page 21: Operational Laws - TU Delft

30IN4390

Bottleneck law

•Relate system throughput

• to device utilization

Dk = Vk Sk: total service demand on device kfor all visits of a job

•The device with the highest utilization (demand) is the bottleneck in the system

Uk = Dk X

Page 22: Operational Laws - TU Delft

31IN4390

Webserver example

• Measurements taken during one hour from a Web server indicate that the utilization of the CPU and the two disks are: UCPU = 0.25, UdiskA = 0.35, and UdiskB = 0.30. The server log shows that 216,000 requests were processed during the measurement interval.

• What are the service demands (the time used by each request) at the CPU and both disks?

• Which component is the bottleneck?

• What is the maximum (potential) throughput?

• What was the response time of the Web server?

tricky!

Page 23: Operational Laws - TU Delft

33IN4390

Asymptotic Bounds for Closed Systems

Upper bounds on throughput

lower bounds on response time can be obtained by considering the service demands only (i.e., without solving any underlying model)

X ≤ 𝒎𝒊𝒏𝟏

𝑫𝒎𝒂𝒙

,𝑵

𝑫+𝒁

R ≥ 𝒎𝒂𝒙 𝑫,𝑵 × 𝑫𝒎𝒂𝒙 − 𝒁

D = σ𝑘 D𝑘

D𝒎𝒂𝒙 = 𝑚𝑎𝑥𝑘 Dk

any intuition?1 or 2 proofs

required?

Page 24: Operational Laws - TU Delft

34IN4390

•when loading the system, the slowest device becomes the bottleneck: X = Uk /Dk ≤ 1/Dk X ≤ 1/Dmax

•max throughput when no queueing occurs (R ≥ D):X = N / (R+Z) ≤ N / (D+Z)

Proof

Uk = Dk X

N = X (R+Z)

X ≤ 𝒎𝒊𝒏𝟏

𝑫𝒎𝒂𝒙

,𝑵

𝑫+𝒁X ≤ 𝒎𝒊𝒏𝟏

𝑫𝒎𝒂𝒙

,𝑵

𝑫+𝒁

Throughput bounds

Page 25: Operational Laws - TU Delft

35IN4390

Proof

•Apply Little’s Law (R = N/X – Z) to previous proof

X ≤ 𝒎𝒊𝒏𝑵

𝑫+𝒁,

𝟏

𝑫𝒎𝒂𝒙

Response time bounds

R ≥ 𝒎𝒂𝒙 𝑫,𝑵 × 𝑫𝒎𝒂𝒙 − 𝒁

Page 26: Operational Laws - TU Delft

36IN4390

Webserver example

• Z =18

• DCPU = 5

• Ddisk a = 4

• Ddisk b = 3

Closed system

• D = 5+4+3 = 12

• Dmax = DCPU = 5

• X ≤ 𝒎𝒊𝒏𝟏

𝑫𝒎𝒂𝒙

,𝑵

𝑫+𝒁

• = 𝒎𝒊𝒏(1/5, N/30)

• R≥ 𝒎𝒂𝒙 𝑫,𝑵 × 𝑫𝒎𝒂𝒙 − 𝒁

• = 𝒎𝒂𝒙(12, 5N – 18)

Page 27: Operational Laws - TU Delft

37IN4390

Operational laws and bounds

UTILIZATION LAW U = X S

LITTLE'S LAW N = X R

FORCED FLOW LAW Xk = Vk X

BOTTLENECK LAW Uk = Dk X

X ≤ 𝒎𝒊𝒏𝟏

𝑫𝒎𝒂𝒙

,𝑵

𝑫+𝒁

R ≥ 𝒎𝒂𝒙 𝑫,𝑵 × 𝑫𝒎𝒂𝒙 − 𝒁