14
# Record stack traces 99 times per second for 30
seconds
sudo perf record -F 99 -p ${pid} -g -- sleep 30s
# Generate human readable stack traces
sudo perf script > stacks.${pid}.out
Slide 15
Slide 15 text
15
•
Image from http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html
2,970 Stack Traces!!!
Slide 16
Slide 16 text
16
Slide 17
Slide 17 text
17
Image from https://github.com/brendangregg/FlameGraph
CPU Flame Graph by Brendan Gregg
Slide 18
Slide 18 text
18
CPU Flame Graph
GZIP
JSON.parse
JSON.parse
React
Slide 19
Slide 19 text
19
Nothing looks so
wrong…?
Slide 20
Slide 20 text
20
https://github.com/Netflix/flamescope
FlameScope
by Netflix cloud performance team
Slide 21
Slide 21 text
21
Finding 1: Metrics Collection from
Histograms
Busy for ~1.5s!
Slide 22
Slide 22 text
22
Finding 1: Metrics Collection from
Histograms
JSON.stringify()
JSON.parse()
in a metrics library
Slide 23
Slide 23 text
23
Finding 2: Garbage Collection
Busy for ~400ms
once in ~10s