felixge's notes on the various go profiling methods that are available.
Find a file
Felix Geisendörfer 81352c678a
Merge pull request #2 from becheran/fix-links
Fix broken references
2021-04-09 13:38:53 +02:00
bench Fix broken references 2021-03-11 12:40:37 +01:00
delve updates 2021-03-22 15:17:01 +01:00
examples Merge pull request #2 from becheran/fix-links 2021-04-09 13:38:53 +02:00
sim more block profile 2021-02-05 10:44:51 +01:00
.gitignore update 2021-02-05 10:44:43 +01:00
block.md Merge pull request #2 from becheran/fix-links 2021-04-09 13:38:53 +02:00
cpu.md Fix broken references 2021-03-11 12:40:37 +01:00
datadog.excalidraw Datadog operation illustration 2021-01-29 12:31:01 +01:00
datadog.md Updates to reflect move to Datadog org 2021-02-19 15:26:28 +01:00
datadog.png Datadog operation illustration 2021-01-29 12:31:01 +01:00
flame-abc.png start cpu note 2021-01-10 15:24:09 +01:00
flame-abc.txt start cpu note 2021-01-10 15:24:09 +01:00
goroutine-matrix.png one more edit 2021-03-15 15:35:56 +01:00
goroutine-stack.excalidraw wip 2021-03-19 15:34:49 +01:00
goroutine-stack.png wip 2021-03-19 15:34:49 +01:00
goroutine.md minor edits 2021-03-18 11:03:11 +01:00
heap.md Updates to reflect move to Datadog org 2021-02-19 15:26:28 +01:00
LICENSE.txt Add LICENSE 2021-02-10 09:46:44 +01:00
mutex.md Updates to reflect move to Datadog org 2021-02-19 15:26:28 +01:00
pprof.md Improve pprof docs 2021-03-06 12:32:51 +01:00
profile.png Fix for darkmode 2021-02-25 16:17:44 +01:00
profile.proto Initial pprof format notes 2021-01-09 16:12:23 +01:00
README.md fix block profiler short description 2021-02-25 23:46:29 +01:00
stack-traces.md Clarify contents of pctab 2021-04-07 20:35:45 +02:00

go-profiler-notes

Hey there 👋🏻, I'm felixge and I've just started a new job at Datadog to work on Continuous Profiling for Go.

I found that Go has a lot of profilers and there are many tools for looking at the data, but that there is very little information on what any of it means. So in order to make sure that I know what I'm talking about, I've started to research the existing profilers and how they work. This repository is my attempt to summarize my findings in the hope that it might be useful to others.

  • pprof tool & format: Describes the pprof tool and the binary data format for storing profiles.
  • Goroutine Profiling: Allows you to get a list of all active goroutines and what they're currently doing.
  • Block Profiling: Understand how much time your code spends waiting on channels and locks.
  • CPU Profiling (🚧 coming soon!)
  • Heap Profiling (🚧 coming soon!)
  • Mutex Profiling (🚧 coming soon!)
  • Wallclock Profiling (🚧 coming soon!)
  • Go Docs
    • Diagnostics: Has a very good overview over the available profiling and tracing facilities but doesn't go into a lot of depth.
    • runtime/pprof: Lists the available profiles and has a little more explanation about what kind of data they produce.
    • runtime: Has documentation on the various control knobs and pprof facilities, e.g. MemProfileRate.
    • net/http/pprof: Not a lot of docs, but diving into the code from there shows how the various profilers can be started/stopped on demand.
  • JDB
    • Profiler labels in Go: An introduction to using pprof labels and how they allow you to add additional context to your profiles.
    • Custom pprof profiles: Example for using custom profiles, shows tracking open/close events of a blob store and how to figure out how many blobs are open at a given time.
    • Mutex profile: Brief intro to the mutex profile.
    • Using Instruments to profile Go programs: How to use the macOS Instruments app (I think it's built on dtrace) to profile Go programs. Not clear what the benfits are, if any.
  • Profiling Go programs with pprof by Julia Evans: A nice tour with a focus on heap profiling and the pprof output format.

Got great links to recommend? Open an issue or PR, I'd happy to add your suggestions : ).

License

The markdown files in this repository are licensed under the CC BY-SA 4.0 license.

Disclaimers

I'm felixge and work at Datadog on Continuous Profiling for Go. You should check it out. We're also hiring : ).

The information on this page is believed to be correct, but no warranty is provided. Feedback is welcome!