pprof

Why can't I see my own application functions in golang's pprof

自闭症网瘾萝莉.ら 提交于 2020-01-15 01:24:32
问题 I'm trying to debug the performance characterics of my own program so I'm following the tutorial on the golang blog. But I have 1 small issues I can't investigate the my own functions or call in the resulting profiling output. I'm using this command to build my binary: go build -ldflags "-s -extldflags -static" -a -installsuffix cgo -o bin/brains And when I use go tool pprof to examine the result I can only (pprof) top10 -cum 2.38mins of 5.25mins total (45.32%) Dropped 125 nodes (cum <= 0

Can't get golang pprof working

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-02 07:40:34
问题 I have tried to profile some golang applications but I couldn't have that working, I have followed these two tutorials: http://blog.golang.org/profiling-go-programs http://saml.rilspace.org/profiling-and-creating-call-graphs-for-go-programs-with-go-tool-pprof Both says that after adding some code lines to the application, you have to execute your app, I did that and I receiveed the following message in the screen: 2015/06/16 12:04:00 profile: cpu profiling enabled, /var/folders/kg

Can't use go tool pprof with an existing server

百般思念 提交于 2019-12-21 03:37:16
问题 I have an existing http server which I would like to profile. I have included _ "net/http/pprof" to my imports, and I already have http server running: router := createRouter() server := &http.Server { Addr: ":8080", Handler: router, ReadTimeout: 15*time.Second, WriteTimeout: 15*time.Second, // MaxHeaderBytes: 4096, } log.Fatal(server.ListenAndServe()) When I'm trying to access http://localhost:8080/debug/pprof/ I get 404 page not found . That's what I get when using go tool pprof on a local

golang tool pprof not working properly - same broken output regardless of profiling target

僤鯓⒐⒋嵵緔 提交于 2019-12-19 18:53:13
问题 I've previously used the pprof tool without issue and it worked great - now I see output like the following no matter what I profile: the application being profiled in this example probably makes 40+ function calls and even more complex apps are producing similar callgraphs for both cpu and memprofiling. The apps Im trying to profile are all web applications, I am profiling them for one minute at a time and using wrk to generate 200,000,000+ requests = all returning data and a 2xx response

How to profile number of goroutines

ぐ巨炮叔叔 提交于 2019-12-12 12:57:36
问题 Basically I want to find if my program is leaking goroutines over time. So I want to see how many goroutines are running over time. Is there any way to do this through pprof ? I've done go tool pprof http://localhost:8888/debug/pprof/block . Which gives me how long is being spent blocked but not how many routines are running. 回答1: Open http://localhost:8888/debug/pprof/ in your browser. You'll see two relevant links: "goroutine" (http://localhost:8888/debug/pprof/goroutine?debug=1) and "full

How can I get samples when running go with pkg/profile enabled?

眉间皱痕 提交于 2019-12-11 17:12:45
问题 I have the following in my main block: func main() { defer profile.Start().Stop() fmt.Println("running version", version, "built on", date) fmt.Println() cmd.Execute() time.Sleep(2 * time.Second) } where cmd is a cobra subcommand. I do a go build, and then I run the binary. I can see that it generates a pprof file: 2018/09/13 18:43:26 profile: cpu profiling enabled, /tmp/profile705487093/cpu.pprof ... output deleted ... 2018/09/13 18:43:31 profile: cpu profiling disabled, /tmp

golang profile with pprof, how to get hit count not duration?

余生长醉 提交于 2019-12-07 10:18:41
问题 how to get hit count like: (pprof) top Total: 2525 samples 298 11.8% 11.8% 345 13.7% runtime.mapaccess1_fast64 268 10.6% 22.4% 2124 84.1% main.FindLoops not, durations like: (pprof) top 2220ms of 3080ms total (72.08%) Dropped 72 nodes (cum <= 15.40ms) Showing top 10 nodes out of 111 (cum >= 60ms) flat flat% sum% cum cum% 1340ms 43.51% 43.51% 1410ms 45.78% runtime.cgocall_errno env: I using golang1.4, add below codes. defer pprof.StopCPUProfile() f, err := os.Create("innercpu.pprof") if err !=

Can't get golang pprof working

只愿长相守 提交于 2019-12-06 03:22:19
I have tried to profile some golang applications but I couldn't have that working, I have followed these two tutorials: http://blog.golang.org/profiling-go-programs http://saml.rilspace.org/profiling-and-creating-call-graphs-for-go-programs-with-go-tool-pprof Both says that after adding some code lines to the application, you have to execute your app, I did that and I receiveed the following message in the screen: 2015/06/16 12:04:00 profile: cpu profiling enabled, /var/folders/kg/4fxym1sn0bx02zl_2sdbmrhr9wjvqt/T/profile680799962/cpu.pprof So, I understand that the profiling is being executed,

golang profile with pprof, how to get hit count not duration?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 15:53:30
how to get hit count like: (pprof) top Total: 2525 samples 298 11.8% 11.8% 345 13.7% runtime.mapaccess1_fast64 268 10.6% 22.4% 2124 84.1% main.FindLoops not, durations like: (pprof) top 2220ms of 3080ms total (72.08%) Dropped 72 nodes (cum <= 15.40ms) Showing top 10 nodes out of 111 (cum >= 60ms) flat flat% sum% cum cum% 1340ms 43.51% 43.51% 1410ms 45.78% runtime.cgocall_errno env: I using golang1.4, add below codes. defer pprof.StopCPUProfile() f, err := os.Create("innercpu.pprof") if err != nil { fmt.Println("Error: ", err) } pprof.StartCPUProfile(f) A.Glyzov You can use go tool pprof

Can't use go tool pprof with an existing server

[亡魂溺海] 提交于 2019-12-03 10:56:05
I have an existing http server which I would like to profile. I have included _ "net/http/pprof" to my imports, and I already have http server running: router := createRouter() server := &http.Server { Addr: ":8080", Handler: router, ReadTimeout: 15*time.Second, WriteTimeout: 15*time.Second, // MaxHeaderBytes: 4096, } log.Fatal(server.ListenAndServe()) When I'm trying to access http://localhost:8080/debug/pprof/ I get 404 page not found . That's what I get when using go tool pprof on a local machine: userver@userver:~/Desktop/gotest$ go tool pprof http://192.168.0.27:8080/ Use of uninitialized