Repository navigation
Fallback to system-wide metrics under cgroups - #73369
Merged
Merged
Conversation
Contributor
|
This is an automated comment for commit ef35860 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
devcrafter
approved these changes
Dec 16, 2024
|
|
||
| if (name.starts_with("cpu")) | ||
| { | ||
| if (cgroup_cpu_metrics_present) |
Member
There was a problem hiding this comment.
Wouldn't it be simpler always to read ProcStatValuesCPU first (it doesn't depend on the number of CPU, so the check below is irrelevant)
Suggested change
| if (cgroup_cpu_metrics_present) | |
| ProcStatValuesCPU current_values{}; | |
| current_values.read(*proc_stat); | |
| /// Skip the CPU metrics if we already have them from cgroup | |
| if (cgroup_cpu_metrics_present) | |
| continue; |
Member
Author
|
|
robot-clickhouse
added a commit
that referenced
this pull request
Dec 17, 2024
This was referenced Dec 17, 2024
robot-clickhouse
added a commit
that referenced
this pull request
Dec 17, 2024
robot-ch-test-poll2
added a commit
that referenced
this pull request
Dec 17, 2024
Backport #73369 to 24.12: Fallback to system-wide metrics under cgroups
nickitat
added a commit
that referenced
this pull request
Dec 18, 2024
Backport #73369 to 24.11: Fallback to system-wide metrics under cgroups
filimonov
reviewed
Feb 26, 2025
| Float64 num_cpus_to_normalize = max_cpu_cgroups > 0 ? max_cpu_cgroups : num_cpus; | ||
|
|
||
| if (num_cpus_to_normalize > 0) | ||
| if (num_cpus_to_normalize > 0 && !cgroup_cpu_metrics_present) |
Member
Author
There was a problem hiding this comment.
have you saw cpu normalized not reported on a cgroups v1 host?
Contributor
There was a problem hiding this comment.
You didn't answer 'why' :P
I didn't check if it was v1 or v2. But they are not there for sure: #76810 (there is even a simple test showing it it fiddle).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
When ClickHouse runs under cgroup we will still collect system-wide asynchronous metrics related to system load, process scheduling, memory etc. They might provide useful signals when ClickHouse is the only process on the host with high resource consumption.
Closes: #71733