Version: main
Profiling kubectl
To profile kubectl
the Go tools needs to be installed. The various kind of go profiles are described in the the pprof
package documentation. A longer pprof
tutorial can be found on the Go blog.
For kubectl, the two most interesting profiles are block
(where do we spend time blocking, eg. waiting for I/O) and cpu
.
We distribute a kubectl-instrumented
package that supports two new command line options:
To generate a profile, use the --profile
option:
Generate a visualization of the profile with pprof
. You will need to graphviz installed.