[英]golang tool pprof not working properly - same broken output regardless of profiling target
我之前使用過pprof工具沒有問題,它工作得很好 - 現在我看到的輸出如下,無論我簡介:
在這個例子中被分析的應用程序可能會進行40多個函數調用,甚至更復雜的應用程序也會為cpu和memprofiling生成類似的調用圖。
我試圖分析的應用程序都是Web應用程序,我一次分析它們一分鍾並使用wrk生成200,000,000多個請求=所有返回數據和2xx響應
pprof幾天前突然停止運行osx yosemite - 試圖解決我最近升級到el capitan的問題,但結果是一樣的。
注意:這不僅僅是調用圖 - 調用列表或top命令產生類似的貧瘠結果,但應用程序本身工作正常:
(pprof) top
269.97kB of 269.97kB total ( 100%)
flat flat% sum% cum cum%
269.97kB 100% 100% 269.97kB 100%
(pprof)
我正在使用以下軟件包:“github.com/davecheney/profile”和go v1.5.1
為清楚起見,這是我正在做的生成配置文件::
我將上面的包導入main.go並將以下內容放在我的主函數的頂部:
defer profile.Start(profile.MemProfile).Stop()
然后我構建二進制文件並運行它:
go build -o orig /Users/danielwall/www/netlistener/application/adrequest.go /Users/danielwall/www/netlistener/application/cookie.go /Users/danielwall/www/netlistener/application/header.go /Users/danielwall/www/netlistener/application/lex.go /Users/danielwall/www/netlistener/application/main.go /Users/danielwall/www/netlistener/application/publisher_ids.go /Users/danielwall/www/netlistener/application/request.go /Users/danielwall/www/netlistener/application/response.go /Users/danielwall/www/netlistener/application/server.go /Users/danielwall/www/netlistener/application/sniff.go /Users/danielwall/www/netlistener/application/status.go /Users/danielwall/www/netlistener/application/transfer.go
./orig
然后我看到這樣的輸出:
2015/11/16 11:39:49 profile: memory profiling enabled, /var/folders/26/2sj70_sn72l_93j7tf6r07gr0000gn/T/profile614358295/mem.pprof
現在我從另一個終端處理應用程序:
wrk -d60 -c10 -H "X-Device: desktop" -H "X-Country-Code: GB" "http://localhost:8189/app?id=111&schema=xml2&ad_type=auto&url=http://test.com/&category=bob"
Running 1m test @ http://localhost:8189/app?id=111&schema=xml2&ad_type=auto&url=http://test.com/&category=bob
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 414.09us 0.92ms 55.36ms 95.66%
Req/Sec 17.57k 3.19k 22.59k 76.00%
2097764 requests in 1.00m, 684.20MB read
Requests/sec: 34958.03
Transfer/sec: 11.40MB
60秒后,我回去查看我的個人資料:
^C2015/11/16 12:05:20 profile: caught interrupt, stopping profiles
go tool pprof /var/folders/26/2sj70_sn72l_93j7tf6r07gr0000gn/T/profile614358295/mem.pprof
任何想法可能會發生在這里或在哪里我可以開始解決/解決這個問題?
歡迎任何幫助建議。
你的go tool pprof
調用缺少二進制文件本身。 稱之為
go tool pprof ./orig /path/to/profile.pprof
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.