-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: throttling row sampling is based on potentially dubious CPU signal #103472
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-queries
SQL Queries Team
Comments
kvoli
added
the
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
label
May 16, 2023
craig bot
pushed a commit
that referenced
this issue
Jun 1, 2023
104153: status: account for gomaxprocs in cpu utilization r=kvoli a=kvoli 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: #101633 Fixes: #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. Co-authored-by: Austen McClernon <[email protected]>
blathers-crl bot
pushed a commit
that referenced
this issue
Jun 1, 2023
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: #101633 Fixes: #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.
kvoli
added a commit
to kvoli/cockroach
that referenced
this issue
Jun 7, 2023
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-queries
SQL Queries Team
The SQL stats row sampler uses the normalized CPU to pace and throttle sampling:
cockroach/pkg/sql/rowexec/sampler.go
Lines 285 to 289 in a0e80d2
However due to #101633, the normalized CPU signal used may be under reported if
GOMAXPROCS
is set to a lower number than the number of CPUs available for the process -num_cpus
.This may lead to a lack of throttling due to the underreported normalized CPU.
Jira issue: CRDB-28020
The text was updated successfully, but these errors were encountered: