第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

profile kubectl using pprof

profile kubectl using pprof

Go
皈依舞 2022-09-05 17:02:19
在 kubernetes 源代碼中,有一個代碼塊處理性能分析部分,但我不能訪問端點(diǎn):in kubernetes/pkgs/kubelet/server/stats/server.gofunc (s *Server) InstallProfilingHandler(enableProfilingLogHandler bool, enableContentionProfiling bool) {    s.addMetricsBucketMatcher("debug")    if !enableProfilingLogHandler {        s.restfulCont.Handle(pprofBasePath, getHandlerForDisabledEndpoint("profiling endpoint is disabled."))        return    }    handlePprofEndpoint := func(req *restful.Request, resp *restful.Response) {        name := strings.TrimPrefix(req.Request.URL.Path, pprofBasePath)        switch name {        case "profile":            pprof.Profile(resp, req.Request)        case "symbol":            pprof.Symbol(resp, req.Request)        case "cmdline":            pprof.Cmdline(resp, req.Request)        case "trace":            pprof.Trace(resp, req.Request)        default:            pprof.Index(resp, req.Request)        }    }    // Setup pprof handlers.    ws := new(restful.WebService).Path(pprofBasePath)    ws.Route(ws.GET("/{subpath:*}").To(handlePprofEndpoint)).Doc("pprof endpoint")    s.restfulCont.Add(ws)    if enableContentionProfiling {        goruntime.SetBlockProfileRate(1)    }}我不知道pprof工具使用的端口,但我發(fā)現(xiàn)它使用:controller-0:/home/sysadmin/go/bin# netstat -atlpn | grep kubelettcp        0      0 127.0.0.1:10248         0.0.0.0:*               LISTEN      184856/kubelet      tcp        0      0 192.168.206.2:49720     192.168.206.1:6443      ESTABLISHED 184856/kubelet      tcp6       0      0 :::10250                :::*                    LISTEN      184856/kubelet 然后我試過了controller-0:/home/sysadmin/go/bin# ./go tool pprof  http://localhost:6443/debug/pprof/mutexFetching profile over HTTP from http://localhost:6443/debug/pprof/mutexhttp://localhost:6443/debug/pprof/mutex: server response: 400 Bad Requestfailed to fetch any source profiles有沒有人知道我應(yīng)該嘗試什么來訪問 pprof 端點(diǎn)?或者如何嘗試不同的方法來分析kubelet過程?
查看完整描述

1 回答

?
海綿寶寶撒

TA貢獻(xiàn)1809條經(jīng)驗(yàn) 獲得超8個贊

嘗試:


$ kubectl proxy &

Starting to serve on 127.0.0.1:8001

$ go tool pprof "http://localhost:8001/api/v1/nodes/${NODE}/proxy/debug/pprof/profile"

當(dāng)你啟動時,所有請求都去 kubelet 運(yùn)行在 .您可以添加所需的任何路徑和它。讓它成為或或你想要的任何東西。kubectl proxyhttp://localhost:8001/api/v1/nodes/${NODE}/proxy/${NODE}/debug/pprof/profiledebug/pprof/heap


查看完整回答
反對 回復(fù) 2022-09-05
  • 1 回答
  • 0 關(guān)注
  • 129 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號