pprof如何进行采样:https://studygolang.com/articles/11873golang
go tool pprof http://localhost:6060/debug/pprof/profile spa
go tool pprof http://localhost:6060/debug/pprof/heap线程
go tool pprof http://localhost:6060/debug/pprof/blockdebug
go tool pprof http://localhost:6060/debug/pprof/mutexcode
$HOST/debug/pprof/profile
,默认进行 30s 的 CPU Profiling,获得一个分析用的 profile 文件$HOST/debug/pprof/block
,查看致使阻塞同步的堆栈跟踪$HOST/debug/pprof/goroutine
,查看当前全部运行的 goroutines 堆栈跟踪$HOST/debug/pprof/heap
,查看活动对象的内存分配状况$HOST/debug/pprof/mutex
,查看致使互斥锁的竞争持有者的堆栈跟踪$HOST/debug/pprof/threadcreate
,查看建立新OS线程的堆栈跟踪