Performance profiler (internal tooling)

Kalen Petersen · Friday Demos · September 12, 2025 · 3:48

Another internal tools demo for the curious about how we understand performance bottlenecks.

Try it yourselfThe full week on docsengineeringinternalproductivitytools

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. back land music. Um, so this is sort of an internal demo for a new tool we added for production um, debugging. Let me figure out where I can share. Um, yes, you can allow. All right, cool. So this tool is called async profiler and it is a tool for kind of introspecting what's going on with our cotlin servers um figuring out where they're spending their memory and CPU usage.

  2. Um Chris wanted to know about how to use this. So this is your demo Chris. Um, we uh are running this on east and I think Donniey's putting it on sandbox uh shortly and it right now we have it set up so that every couple minutes it runs for about 10 seconds samples whatever is happening in the system and then dumps a log.

  3. We're dumping them into this into our runtime logs along with all the J prof stuff and profiles. So you can go find either your web server, your worker, and you kind of dig in through, you know, your times, month, date, you know, day, month, year, and then we just have a whole bunch of these different profiles. And so you can pick whichever one you've got.

  4. Um, I picked one earlier and I'm going to show that other screen. So once you've downloaded one of those, you can pull up Intelligj And in Intelligj, let me just close these things here, you just open up a file. Um, I've got some recent snapshots. So, these are JFR ones. And if I pick one of these, um, this will give you a couple different views of your data.

  5. There's the flame graph, call tree, timeline, and we also have either CPU or memory. So if we look at the CPU and we can open up the flame graph and sort of a the width of the bar is how the proportion of what it's using. So we can see that in this case a large amount of our time is in this G1 GC.

  6. So we're basically spending most of our time in the garbage collector. Um and if we flip over to the memory allocations, we can see we're allocating a huge amount of memory and copying dimensions here. And again, so this is kind of like a call stack of which things are calling which and how much memory each one's allocating.

  7. And we can even just click on those. And when we're in Intelligj, it'll take you right to the code where you're at in the different parts of the stack. And we'll also should even tell you kind of a summary of how much data is being called there or being allocated from that location. Um, you can also do a timeline view which I thought was pretty interesting where you can see, you know, we're running at 60 70% CPU and all your different threads.

  8. You know, initially the GC is not doing a lot and then it kind of eventually the GC is taking up all of our time. Um and you can go and you can pick a particular you know process thread and if you click on that you can get a stack trace for what was happening at the time when that was and that also is kind of you can still click through and you know figure out where you're at in the code and that so that's async profiler it's um was helpful for finding this memory issue already yesterday or the day before and I'm sure we're going to be looking at it plenty more in the near term.

  9. from future.