我之前使用过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
| 归档时间: | 
 | 
| 查看次数: | 998 次 | 
| 最近记录: |