go pprof 性能分析工具

安装 graphviz

yum install graphviz

 开始采集:

go tool pprof http://192.168.100.100:1000/debug/pprof/heap

输出 svg 文件,web可以查看

#go tool pprof http://192.168.100.100:1000/debug/pprof/heap
Fetching profile over HTTP from http://192.168.100.100:1000/debug/pprof/heap
Saved profile in /root/pprof/pprof.demo.alloc_objects.alloc_space.inuse_objects.inuse_space.002.pb.gz
File: demo
Type: inuse_space
Time: Mar 7, 2023 at 2:50pm (CST)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) svg
Generating report in profile002.svg
(pprof)

 

posted @ 2023-03-07 14:50  salami_china  阅读(29)  评论(0编辑  收藏  举报