A Evolução 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í??
Profiling.
Mas o que são profilers?
Ferramentas para análise um programa.
Sampling vs. Tracing
Amostras vs. Eventos
Não foi sempre assim!
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. ●
Somente dentro da aplicação.
# ./syscount -cd 5 -t 10 Tracing for 5 seconds. Top 10 only... SYSCALL COUNT gettimeofday 1009 write 3583 read 8174 openat 21550 newfstat 21558 open 21824 fchdir 43098 getdents 43106 close 43694 newfstatat 110936 https://github.com/brendangregg/perf-tools
https://medium.com/netflix-techblog/java-in-flames-e763b3d32166 Kernel Java JVM GC
https://medium.com/netflix-techblog/java-in-flames-e763b3d32166 Kernel Java JVM GC
(EXTENDED) BERKELEY PACKET FILTER
# 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, options [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, options [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
Brendan Gregg, 2017
Mas qual a grande vantagem disto?
Eficiência.
# ./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
https://github.com/iovisor/bcc
Brendan Gregg, 2018
https://github.com/Netflix/vector
https://github.com/spiermar/d3-flame-graph
https://github.com/spiermar/d3-flame-graph
https://github.com/Netflix/flamescope
Brendan Gregg, 2018
https://github.com/Netflix/flamescope
Recap. application profilers GUIs / Vector ● ● system profilers (perf, ftrace) flame graphs (e differentials) ● ● mixed-mode profiles FlameScope (padrões) ● ● eBPF / BCC (scripts) ●
Obrigado. Martin Spier martinspier.io @spiermar unchartedcorners
Recommend
More recommend