run golang cpu profile for 5mins but only got 1.64mins (32.69%) samples

94 views
Skip to first unread message

lqiy...@gmail.com

unread,
Jun 30, 2020, 12:16:54 PM6/30/20
to golang-nuts
$ go version
go version go1.13.10

In the container, the golang process used 100% of the CPU. When I took a 5minutes CPU profile, the result shows that only 1.64mins (32.69%) samples are returned. Is it normal?

go tool pprof autoscaler_cpuprofile.out
File: autoscaler
Type: cpu
Time: Jun 29, 2020 at 11:21pm (CST)
Duration: 5.01mins, Total samples = 1.64mins (32.69%)

Volker Dobler

unread,
Jul 1, 2020, 4:39:18 AM7/1/20
to golang-nuts
Yes, the profile is sampling (not  a full capture but just a sample).

V. 

bobo qi

unread,
Jul 9, 2020, 9:45:08 PM7/9/20
to golang-nuts
Thank you Volker. From the golang document, when getting cpu profile, it will stop the golang runtime 100 times per second, so I think for 5 mins, there should be 5*60*1000 samples. Am I wrong?

在 2020年7月1日星期三 UTC+8下午4:39:18,Volker Dobler写道:
Reply all
Reply to author
Forward
0 new messages