pprof linux 使用
1、生成xxx…pb.gz
go tool pprof -seconds=600 http://172.26.46.41:80/debug/pprof/block
2、在浏览器生成图片
go tool pprof -http=:8000 xxx…pb.gz
3、pprof 部分字段解析:
2 allocs # 所有过去内存分析采样
0 block # 导致同步原语阻塞的堆栈跟踪
0 cmdline # 程序启动参数
4 goroutine # 所有当前goroutine堆栈跟踪
2 heap # 活动对象内存分配采样
0 mutex # 互斥锁跟踪
0 profile # 生成cpuprofile文件 生成文件使用go tool pprof工具分析
8 threadcreate # 创建系统线程的堆栈跟踪
0 trace # 对当前程序执行的跟踪 生成文件使用go tool trace工具分析
full goroutine stack dump # 显示所有goroutine的堆栈