expected number of pprof 'total samples'

89 views
Skip to first unread message

Xiangdong Ji

unread,
Apr 29, 2021, 10:45:07 PM4/29/21
to golang-nuts
Hi

I wonder if the expected number of pprof 'total samples' could be calculated by:
                duration * sample_rate (100HZ) * CPU usage (by 'top')

say if my program's CPU usage reported by 'top' is 200%, and sampling period is 30 seconds, could I expect the total samples of pprof is approximately:
                  30 * 100 * 2  => 6K ?

The formula works well on some physical machines/docker containers, but not all of them, sometimes the samples made by pprof is only 50~60% of the expected number, that ratio is stable on a specific machine/container.  Curious to know what could be the rationale behind it?

Thanks.


Reply all
Reply to author
Forward
0 new messages