Saving 13M Computational Minutes per Day with Flame Graphs
techblog.netflix.com
techblog.netflix.com
Visualization is an often overlooked tool in CS -- for example IDEs do little to zero visualization... only LightTable is starting to break out of the traditional text document. It also shows that depending on the problem visualization & data can be morphed and stretched to provide new insights when others might have walked away.
So why isn't this something that's a part of job interviewing or a bigger part of our normal toolbox as engineers?
It's often overlooked, because generating meaningful data, that can provide visual insight, is usually very difficult. Right now I'm working on a blog post that goes over how you can use motion bubble charts to track code changes and I use GitLab as an example. You can find a draft of the blog at:
http://gitsense.github.io/blog/motion-bubble-charts.html
Note the blog post is still in DRAFT state, so there are broken links and grammatical errors and what not.
Capturing meaningful data at the Enterprise scale, requires a lot of effort. There is a reason why I ended up creating my own real-time process monitoring system:
http://gitsense.github.io/blog/realtime-process-monitoring.h...
What I'm ultimately hoping to do with the metrics, is create a new way to visual Git logs and improve how we approach complex code reviews and diffs.
Really great stuff. The spot where he gets to a pretty good description of how he uses his flame graph is roughly here: https://youtu.be/O1YP8QP9gLA?t=611
With respect to that blog-post the bit about the truncated towers is a bit of a red herring if you're 100% new to flame graphs.
The real meaty bits are the wide sections.
BTW, this is a different flame graph and optimization than the one discussed in the YouTube video. We use flame graphs extensively throughout Netflix.
Some 15 minutes of work improved CPU usage of my team's biggest fleet by ~40%. Considering we scaled up to 1500 c3.4xlarge hosts at peak in NA alone on that fleet, those 15 minutes kinda made my month :)
One thing to note once you eliminate the easy pickings is that as you go higher up the call graph, the profiler visualization is often misleading. There may be sections of code without safe-points, and stuff that appears wide on the flame graph may just be getting blamed for adjacent code that doesn't have safe points.
A single call wasn't so bad, but the lookup was happening many hundreds of times per request adding seconds to some requests. Wild how much difference a relatively small thing can make.
Ultimately, we do care about the total time taken, but the approaches necessary for the two cases above are very different. In many cases, the method that is simply called very often will call for some type of caching solution in the caller, while the more expensive method will require retooling within the method itself.
com.netflix.vulturemonkey.cow.iguana.MacawSquirrel
com.netflix.ape.serpent.vulture.ApeVultureMantis
com.netflix.iguanas.monkey.insect.IguanaRabbit
Any idea what's up with that?I've wondered about the question myself when encountering incredibly long stack traces while troubleshooting Java systems. I've also wondered if there is some more general dysfunction indicated. I've see impressive stack traces in C and C++, but nothing quite like what I've found in Java. What is the experience of C# programmers?