A Evoluo de Profilers na Netflix MARTIN SPIER PERFORMANCE - - PowerPoint PPT Presentation

a evolu o de profilers na netflix
SMART_READER_LITE
LIVE PREVIEW

A Evoluo de Profilers na Netflix MARTIN SPIER PERFORMANCE - - PowerPoint PPT Presentation

A Evoluo de Profilers na Netflix MARTIN SPIER PERFORMANCE ARCHITECT @spiermar Performance do que? Do produto. https://www.infoq.com/br/presentations/um-dia-na-vida-de-um-arquiteto-de-performance-do-netflix Uma vez identificado? E a??


slide-1
SLIDE 1

A Evolução de Profilers na Netflix

MARTIN SPIER PERFORMANCE ARCHITECT

@spiermar

slide-2
SLIDE 2

Performance do que?

slide-3
SLIDE 3

Do produto.

slide-4
SLIDE 4
slide-5
SLIDE 5
slide-6
SLIDE 6
slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12

https://www.infoq.com/br/presentations/um-dia-na-vida-de-um-arquiteto-de-performance-do-netflix

slide-13
SLIDE 13

Uma vez identificado? E aí??

slide-14
SLIDE 14
slide-15
SLIDE 15

Profiling.

slide-16
SLIDE 16

Mas o que são profilers?

slide-17
SLIDE 17

Ferramentas para análise um programa.

slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20

Sampling vs. Tracing

slide-21
SLIDE 21

Amostras vs. Eventos

slide-22
SLIDE 22

Não foi sempre assim!

slide-23
SLIDE 23

Profiling de aplicação.

  • Específicos para cada linguagem/stack.
  • Multiplas opções.
  • Fortemente integrado com a aplicação.
  • Ou virtual machine.
  • Sampling e/ou tracing.
  • Necessita instrumentação manual ou não.
slide-24
SLIDE 24

Somente dentro da aplicação.

slide-25
SLIDE 25
slide-26
SLIDE 26

# ./syscount -cd 5 -t 10 Tracing for 5 seconds. Top 10 only... SYSCALL COUNT gettimeofday 1009 write 3583 read 8174

  • penat 21550

newfstat 21558

  • pen 21824

fchdir 43098 getdents 43106 close 43694 newfstatat 110936

https://github.com/brendangregg/perf-tools

slide-27
SLIDE 27

GC Java JVM Kernel

https://medium.com/netflix-techblog/java-in-flames-e763b3d32166

slide-28
SLIDE 28
slide-29
SLIDE 29

GC Java JVM Kernel

https://medium.com/netflix-techblog/java-in-flames-e763b3d32166

slide-30
SLIDE 30

(EXTENDED) BERKELEY PACKET FILTER

slide-31
SLIDE 31

# tcpdump -ni tun0 ip and tcp and port 80 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on tun0, link-type RAW (Raw IP), capture size 262144 bytes 09:23:51.793470 IP 192.168.1.6.34512 > 100.82.154.210.80: Flags [S], seq 3536866140, win 29200,

  • ptions [mss 1460,sackOK,TS val 536156148 ecr 0,nop,wscale 7], length 0

09:23:51.793583 IP 192.168.1.6.34514 > 100.82.154.210.80: Flags [S], seq 446464156, win 29200,

  • ptions [mss 1460,sackOK,TS val 536156148 ecr 0,nop,wscale 7], length 0

09:23:51.863055 IP 100.82.154.210.80 > 192.168.1.6.34512: Flags [S.], seq 695094378, ack 3536866141, win 28960, options [mss 1355,sackOK,TS val 91922679 ecr 536156148,nop,wscale 8], length 0 ... ^C 26 packets captured 26 packets received by filter 0 packets dropped by kernel

slide-32
SLIDE 32
slide-33
SLIDE 33

Brendan Gregg, 2017

slide-34
SLIDE 34

Mas qual a grande vantagem disto?

slide-35
SLIDE 35

Eficiência.

slide-36
SLIDE 36

# ./profile -f -p `pgrep -n func_ab` 5 func_ab;[unknown];__libc_start_main;main;func_a 2 func_ab;[unknown];__libc_start_main;main;func_b 2 func_ab;[unknown];__libc_start_main;main;func_a 11 func_ab;[unknown];__libc_start_main;main;func_b 12 func_ab;[unknown];__libc_start_main;main;func_a 23 func_ab;[unknown];__libc_start_main;main;func_b 28 func_ab;[unknown];__libc_start_main;main;func_b 57 func_ab;[unknown];__libc_start_main;main;func_a 64

slide-37
SLIDE 37

https://github.com/iovisor/bcc

slide-38
SLIDE 38

Brendan Gregg, 2018

slide-39
SLIDE 39
slide-40
SLIDE 40
slide-41
SLIDE 41
slide-42
SLIDE 42

https://github.com/Netflix/vector

slide-43
SLIDE 43
slide-44
SLIDE 44

https://github.com/spiermar/d3-flame-graph

slide-45
SLIDE 45

https://github.com/spiermar/d3-flame-graph

slide-46
SLIDE 46

https://github.com/Netflix/flamescope

slide-47
SLIDE 47

Brendan Gregg, 2018

slide-48
SLIDE 48
slide-49
SLIDE 49
slide-50
SLIDE 50
slide-51
SLIDE 51
slide-52
SLIDE 52
slide-53
SLIDE 53
slide-54
SLIDE 54
slide-55
SLIDE 55
slide-56
SLIDE 56
slide-57
SLIDE 57
slide-58
SLIDE 58
slide-59
SLIDE 59
slide-60
SLIDE 60
slide-61
SLIDE 61
slide-62
SLIDE 62
slide-63
SLIDE 63
slide-64
SLIDE 64
slide-65
SLIDE 65
slide-66
SLIDE 66

https://github.com/Netflix/flamescope

slide-67
SLIDE 67

Recap.

  • application profilers
  • system profilers (perf, ftrace)
  • mixed-mode profiles
  • eBPF / BCC (scripts)
  • GUIs / Vector
  • flame graphs (e differentials)
  • FlameScope (padrões)
slide-68
SLIDE 68

Obrigado.

Martin Spier martinspier.io @spiermar unchartedcorners