🔥 FlamegrapHs! 🔥


adam meghji


Co-Founder & CTO, Universe
Vice President, Ticketmaster 

Entrepreneur & hacker.
Passionate about DevOps & APIs
 

     


Create an event and sell tickets within minutes       


 


Mobile ticketing with at-the-door payments

           

 


flame-whats?!



🔥 flamegraphs! 🔥


Profiling by sampling at a fixed rate.

A stack trace is captured at each moment in time.

Originated in DTrace for kernel / systems profiling

SUPER EASY to add to Ruby / Rails apps!

FLAMEGRAPH ANATOMY 😷

Call stack
Time


flamegraph layers 🍰

Mouseover to reveal that layer's stack trace

🔩 installation 🔨




Happy flamegraph 😌


Reasonably bell-curved, LGTM


SAD FLAMEGRAPH #1 😅


What's that large flat-line?



SAD FLAMEGRAPH #1 😑


CLUE #1 ... 

 

SAD FLAMEGRAPH #1 😢


CLUE #2 ... 

      

SAD FLAMEGRAPH #1 😭


ANSWER: Slow microservice call :) 

           

SAD FLAMEGRAPH #2 😅


What are those spikes?





 

SAD FLAMEGRAPH #2 😑


CLUE #1 ... 

           

SAD FLAMEGRAPH #2 😢


CLUE #2 ... 

                

SAD FLAMEGRAPH #2 😭


ANSWER: 1+N Query!
1 record has_many N records fetched individually.
                


REAL EXAMPLE ..


uncached admin request 😫


numerous problems 💀


PROBLEM #1 😰


47.41% time spent! 💩

We're spending a lot of time
counting something in a serializer.

AFTER WE OPTIMIZE .. 😂


Still bad, BUT 2x better! 🍻



QUESTIONS?


🙋🙋🙋


happy hacking! 👊


https://universe.com

@AdamMeghji
adam@universe.com
Made with Slides.com