Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
status: account for gomaxprocs in cpu utilization
When a CRDB process had GOMAXPROCS set lower than the number of CPUs available, the normalized CPU utilization metric would only account for the number of processors. However, the process could never use more than GOMAXPROCS processors in parallel, capping CPU capacity. As a result, the normalized CPU utilization would be under reported. e.g. When the number of CPUs available is 4, GOMAXPROCS is 2 and the usage is 1, utilization would be reported as 25%, whilst the real utilized capacity is 50%. Update the normalized CPU calculation to take the GOMAXPROCS into account, using the smallest capacity for utilization calculation. This affects the `sys.cpu.combined.percent-normalized` metric. Fixes: cockroachdb#101633 Fixes: cockroachdb#103472 Release note (bug fix): `sys.cpu.combined.percent-normalized` now uses `GOMAXPROCS`, if lower than the number of CPU shares when calculating CPU utilization.
- Loading branch information