golang借助 pprof调试线上cpu,内存,goroutine问题
1.相关go代码 import _ "net/http/pprof" // 监听端口 func main(){ go func() { defer func() { if r := recover(); r != nil { log.Println(errors.New("灾难错误"), r) } }() http.ListenAndServe("0.0.0.0:8899", nil) }() ..... }2.访问链接http://127.0
原创
2022-03-25 17:57:07 ·
1613 阅读 ·
0 评论