Golang系统性能优化有什么最佳实践

GolangBlockchain · · 886 次点击
pprof的调优功能不止cpu功能,可以进入链接查看相关功能 ``` cpu(CPU Profiling): $HOST/debug/pprof/profile,默认进行 30s 的 CPU Profiling,得到一个分析用的 profile 文件 block(Block Profiling):$HOST/debug/pprof/block,查看导致阻塞同步的堆栈跟踪 goroutine:$HOST/debug/pprof/goroutine,查看当前所有运行的 goroutines 堆栈跟踪 heap(Memory Profiling): $HOST/debug/pprof/heap,查看活动对象的内存分配情况 mutex(Mutex Profiling):$HOST/debug/pprof/mutex,查看导致互斥锁的竞争持有者的堆栈跟踪 threadcreate:$HOST/debug/pprof/threadcreate,查看创建新OS线程的堆栈跟踪 ``` 不排除楼主有缓慢的内存增高,可以通过heap和goroutine查看内存和堆栈
#5
更多评论
看看数据库吧。 或者有没有什么特别耗时的操作。 注册用户几百这个和语言无关了。
#1
pprof 性能调优 https://segmentfault.com/a/1190000016412013
#2