go-profiler-notes

felixge 对现有的各种 go profiling 方法的笔记。「felixge's notes on the various go profiling methods that are available.」

Github星跟蹤圖

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!

主要指標

概覽
名稱與所有者DataDog/go-profiler-notes
主編程語言Jupyter Notebook
編程語言Jupyter Notebook (語言數: 5)
平台
許可證Creative Commons Attribution Share Alike 4.0 International
所有者活动
創建於2021-01-07 20:35:32
推送於2025-04-29 18:27:19
最后一次提交
發布數0
用户参与
星數3.6k
關注者數102
派生數217
提交數186
已啟用問題?
問題數4
打開的問題數0
拉請求數20
打開的拉請求數2
關閉的拉請求數2
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?