Slide 1

Slide 1 text

The Maths of Microscaling Liz Rice @lizrice | @microscaling

Slide 2

Slide 2 text

What is Microscaling? Assumptions Some theory Some experiments

Slide 3

Slide 3 text

What is Microscaling?

Slide 4

Slide 4 text

Traffic spike

Slide 5

Slide 5 text

Too much work Spare capacity

Slide 6

Slide 6 text

container scaling work performance metrics

Slide 7

Slide 7 text

work performance metrics container scaling VM autoscaling

Slide 8

Slide 8 text

True for regular autoscaling too VMs take much longer to scale

Slide 9

Slide 9 text

Orchestration Heterogenous services Cattle not pets

Slide 10

Slide 10 text

Performance targets

Slide 11

Slide 11 text

How many containers? Request processing time Rate of requests known? predictable?

Slide 12

Slide 12 text

performance target actual performance error time t

Slide 13

Slide 13 text

performance target p time t actual performance x e(t) = x(t) - p(t) e(t) → 0 error e

Slide 14

Slide 14 text

x(t) is proportional to n(t) n(t) = k x(t) error e time t number of containers n

Slide 15

Slide 15 text

x(t) is proportional to n(t) nope! error e time t number of containers n d(t) is proportional to e(t) d

Slide 16

Slide 16 text

Time delays It’s a dynamical system

Slide 17

Slide 17 text

Woah, the future! error e time t d(t) is proportional to e(t + T) T d

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Control theory!

Slide 20

Slide 20 text

PID controller

Slide 21

Slide 21 text

error e time t Proportional term d(t) = Kp e(t) The further we are below target the more containers we need

Slide 22

Slide 22 text

error e time t Derivative term The faster we approach target the fewer containers we need d(t) = Kp e(t) + Kd ė(t)

Slide 23

Slide 23 text

error e time t Integral term d(t) = Kp e(t) + Kd ė(t) + Ki e(t) Offset errors accumulated over time ∫

Slide 24

Slide 24 text

Which values for K? Discrete containers?

Slide 25

Slide 25 text

Simulator goo.gl/KAqT5y

Slide 26

Slide 26 text

It works! But it’s non-trivial to tune

Slide 27

Slide 27 text

Known behaviours Machine learning

Slide 28

Slide 28 text

Container parameters = metadata microbadger.com

Slide 29

Slide 29 text

github.com/microscaling @lizrice | @microscaling app.microscaling.com microbadger.com