Post

pporf使用

下载pporf:

cpu:export PPROF_TMPDIR=/home/foo; go tool pprof http://127.0.0.1:31777/debug/pprof/profile?second=30

内存:export PPROF_TMPDIR=/home/foo; go tool pprof --inuse_space http://127.0.0.1:31777/debug/pprof/heap?second=30

trace: curl -s http://localhost:1777/debug/pprof/trace?seconds=5 > server-trace.pprof

分析pporf:

cpu:go tool pprof --http=0.0.0.0:9998 pprof.xxx.cpu.008.pb.gz

内存:go tool pprof --http=0.0.0.0:9999 pprof.xxxx.008.pb.gz

trace: go tool trace server-trace.pprof

pool池化对象,getslow但不newobject

img.png

  • 需要跨P获取对象
  • 解决:在同一个G中Get\Put对象
This post is licensed under CC BY 4.0 by the author.