-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Memory stats for cgroup-v2 #10286
Memory stats for cgroup-v2 #10286
Conversation
If the host is running with cgroup-v2, RSS and Max Usage doesn't get reported anymore.
If the docker engine is running on cgroup-v2 host, then RSS and Max Usage doesn't get reported. Using a heauristic here to avoid adding more API calls to the Docker Engine to infer cgroups version. Also, opted to avoid coordinating stats collection with fingerprinting, which adds concurrency complexities.
If a task doesn't report RSS, let's use memory usage.
866ca35
to
f14921d
Compare
|
||
// cgroup-v2 only exposes a subset of memory stats | ||
DockerCgroupV1MeasuredMemStats = []string{"RSS", "Cache", "Swap", "Usage", "Max Usage"} | ||
DockerCgroupV2MeasuredMemStats = []string{"Cache", "Swap", "Usage"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #9073 we have an issue where metrics that aren't being measured are still being emitted to the metrics endpoint. Does this help with that situation here or will this still result in empty metrics being emitted? See task_runner.go#L1309-L1336
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wouldn't address that issue. We can update task_runners.go to see if the metrics are measured.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Memory stats for cgroup-v2
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
When running with cgroup-v2, the measured memory stats are Usage, Cache, and Swap only: https://github.com/opencontainers/runc/blob/v1.0.0-rc93/libcontainer/cgroups/fs2/memory.go#L75-L106 .
Also, in RSS isn't measured in a task, then
nomad alloc status
will use the reported Usage for the top level item. This PR only changes the CLI, and we need to update the UI as well.Fixes #10190
Related to #10251