Open
Description
We'd like to dump periodic CPU profiles on every node. Or at least when CPU usage increases with spikes. That is, we'd like to reuse a similar logic at the one we already use to collect heap dumps and goroutine dumps (#75799).
Unfortunately, the pprof
default profile rate (100Hz) is causing a noticeable (1-2%) performance dip.
Given that we usually need profiles when CPU is overloaded, the additional cost due to profiling is unwelcome.
So we'd like to explore a way to collect profiles at a lower sampling rate, to lower the overhead.
Sadly, the code in pprof.StartCPUProfile()
which we currently use, hardcodes the rate at 100Hz.
We haven't yet found another way to do this short of forking pprof
.
Jira issue: CRDB-12842