You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran GODEBUG=gctrace=1; with GODEBUG=gcpacertrace=1 and compared the cpu % output
What did you expect to see?
cpu usage calculations between the two metrics approximately the same
What did you see instead?
Unless I am misinterpreting the data in GODEBUG=gctrace=1, gcpacertrace is reporting much higher cpu usage than gctrace
Taking gc38 as an example, I calculate cpu usage in gctrace like this. 38 shows 55 ms of wall time for the mark phase. As GOMAXPROCs is 4, the gc thinks 210 ms (55 *4) are available during the mark phase. But only 45 ms of cpu time are being used, so cpu time is about 20%.
However, the pacer in the next line reports cpu usage of 51%.
In gc39, there is 86 ms of wall time for the mark phase. 344 ms are available, and 86ms of cpu time are used so 25% is used.
Summary, in between gcs 38 and 39, which report 20% and 25% cpu time respectively, the pacer reports 51% usage.
gc 38 @35.742s 0%: 0.10+55+0.085 ms clock, 0.40+25/45/71+0.34 ms cpu, 971->972->970 MB, 972 MB goal, 0 MB stacks, 0 MB globals, 4 P
pacer: assist ratio=+4.395162e+001 (scan 15 MB in 971->972 MB) workers=1++0.000000e+000
pacer: 51% CPU (25 exp.) for 16158064+18488+488544 B work (16658104 B exp.) in 1018988056 B -> 1019364368 B (∆goal -105555, cons/mark +8.123204e-002)
gc 39 @35.820s 0%: 0.10+86+0.14 ms clock, 0.42+91/86/91+0.59 ms cpu, 971->972->970 MB, 972 MB goal, 0 MB stacks, 0 MB globals, 4 P
pacer: assist ratio=+3.441907e+001 (scan 15 MB in 971->972 MB) workers=1++0.000000e+000
The text was updated successfully, but these errors were encountered:
It's a bit confusing, but the output is correct. This line:
pacer: 51% CPU (25 exp.) for 16158064+18488+488544 B work (16658104 B exp.) in 1018988056 B -> 1019364368 B (∆goal -105555, cons/mark +8.123204e-002)
Refers to this line:
gc 39 @35.820s 0%: 0.10+86+0.14 ms clock, 0.42+91/86/91+0.59 ms cpu, 971->972->970 MB, 972 MB goal, 0 MB stacks, 0 MB globals, 4 P
86 ms wall clock, 86 ms dedicated GC CPU, 91 ms GC assists. (86 + 91 cpu-ms) / (86 ms * 4 cpu) = 51.4%
The gcpacertrace output is really an expert tool, so it's not designed with most users in mind. It has some rough edges if you're not already familiar with the codebase. It's a debugging tool for the pacer, really. gctrace is a bit more friendly, but still less user-focused than, say, CPU profiling.
Closing, since I don't think there's anything actionable. If you think something should change about the output, feel free to send a CL and we can hash it out there. Thanks.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Ran GODEBUG=gctrace=1; with GODEBUG=gcpacertrace=1 and compared the cpu % output
What did you expect to see?
cpu usage calculations between the two metrics approximately the same
What did you see instead?
Unless I am misinterpreting the data in GODEBUG=gctrace=1, gcpacertrace is reporting much higher cpu usage than gctrace
Taking gc38 as an example, I calculate cpu usage in gctrace like this. 38 shows 55 ms of wall time for the mark phase. As GOMAXPROCs is 4, the gc thinks 210 ms (55 *4) are available during the mark phase. But only 45 ms of cpu time are being used, so cpu time is about 20%.
However, the pacer in the next line reports cpu usage of 51%.
In gc39, there is 86 ms of wall time for the mark phase. 344 ms are available, and 86ms of cpu time are used so 25% is used.
Summary, in between gcs 38 and 39, which report 20% and 25% cpu time respectively, the pacer reports 51% usage.
The text was updated successfully, but these errors were encountered: