mature optimization (carlos bueno, facebook)

Post on 15-Dec-2014

459 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

HighLoad++ 2013

TRANSCRIPT

Mature Optimization

Carlos Bueno <carlos@bueno.org>

FACT: You are not clairvoyant.

Who cares?

Very obvious!

The Plan 1: Measure Carefully. 2: ???? 3: Profit!

The Plan (revised) 0: Define the Problem. 1: Measure Carefully. 2: ???? 3: Profit!

Define the Problem. “WidgetFactoryServer is too slow!”

Define the Problem. “WidgetFactoryServer is too slow!” Problem definitions must be specific enough to suggest a way forward, and testable. You need a falsifiable statement.

Define the Problem. •  WidgetFactoryServer is CPU-bound

•  Run a profiler

•  Optimize the slow functions

•  CPU time should decrease

FACT: People have a lot of advice about writing fast programs. Most of it is horseshit.

HipHop Virtual Machine (HHVM)

C++

JIT

CPU Time

The Plan 0: Define the Problem. 1: Measure Carefully. 2: ???? 3: Profit!

Measure continuously.

Daily & Weekly Cycles

Collect RAW data, not metrics.

Record lots of metadata.

Directly measure what you are optimizing.

Distrust numbers. Especially your own.

“I don’t believe in the Performance Fairy.” Jeff Rothschild

Monitoring & Investigation

•  Crashing is cheap.

•  No errors logged, but no data returned.

•  Did you buy faster servers?

•  Did you turn off slower servers?

•  Did some servers just die?

Choose metrics carefully.

Questions? carlos.bueno.org/optimization

top related