Slide 1

Slide 1 text

DIY Performance Tuning When All You Have is Python Amy Nguyen @amyngyn amynguyen.net March 22, 2017

Slide 2

Slide 2 text

Hi! I'm Amy. ● Software engineer at Pinterest since 2015. ● What I've been doing on Visibility Team: distributed tracing, writing a cache, a whole "D3 is everything" phase, a UX design overhaul of our internal tools ● Find me on Twitter at @amyngyn!

Slide 3

Slide 3 text

Distributed Tracing

Slide 4

Slide 4 text

Does my function call this service?

Slide 5

Slide 5 text

Does my function call this service? How much time is my function spending on calling each service?

Slide 6

Slide 6 text

Does my function call this service? How much time is my function spending on calling each service? What functions do each of those backend services call?

Slide 7

Slide 7 text

Why does my function take so long? Does my function call this service? How much time is my function spending on calling each service? What functions do each of those backend services call?

Slide 8

Slide 8 text

Why does my function take so long? Does my function call this service? How much time is my function spending on calling each service? What functions do each of those backend services call? ? ? ? ? ?

Slide 9

Slide 9 text

What if we could record (or trace) data about every network request going through our system and analyze the data?

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

my_function urllib ??? memcache ??? mysql ???

Slide 18

Slide 18 text

my_function urllib ??? socket memcache ??? mysql ???

Slide 19

Slide 19 text

Monkey patching

Slide 20

Slide 20 text

my_function urllib ??? socket memcache ??? mysql ??? ! ! !

Slide 21

Slide 21 text

my_function urllib ??? my_socket memcache ??? mysql ??? ! ! !

Slide 22

Slide 22 text

What can I do now that I went through all of this work?

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

20% decrease in latency!!!!

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Thanks!