在Debian中监控Go语言性能可使用以下工具和方法:
pprof(内置工具)
net/http/pprof包,启动HTTP服务(如http.ListenAndServe("localhost:6060", nil))。http://localhost:6060/debug/pprof/profile?seconds=30生成30秒采样数据,用go tool pprof分析。http://localhost:6060/debug/pprof/heap查看内存分配情况。http://localhost:6060/debug/pprof/goroutine查看协程状态。go tool pprof -http=:8081 profile.pprof。Prometheus + Grafana
prometheus/client_golang)采集指标(CPU、内存、请求延迟等),存储到时间序列数据库。系统工具
第三方工具
操作建议:
参考资料: