Use pprof to do CPU, Memory profiling can help you understand the runtime status of YuniKorn scheduler. Profiling instruments have been
added to YuniKorn rest service, we can easily retrieve and analyze them from HTTP
go tool pprof http://localhost:9080/debug/pprof/heap
this will return a snapshot of current heap which allows us to check memory usage.
Once it enters the interactive mode, you can run some useful commands. Such as
top can list top memory consumption objects.
Showing nodes accounting for 83.58MB, 98.82% of 84.58MB total
you can also run web, pdf or gif command to get the graph for heap.
Download profiling samples and analyze it locally#
We have included essential go/go-tool binaries in scheduler docker image, you should be able to do some basic profiling
analysis inside of the docker container. However, if you want to dig into some issues, it might be better to do the analysis
locally. Then you need to copy the samples file to local environment first. The command to copy files is like following: