Skip to content

Respect cgroup limits - #38

Open
tmakatos wants to merge 1 commit into
add_psi_monitoringfrom
respect_cgroup_limits
Open

tmakatos wants to merge 1 commit into
add_psi_monitoringfrom
respect_cgroup_limits

Conversation

@tmakatos

Copy link
Copy Markdown
Collaborator

A VM process can have less CPU capacity than its vCPU count and
host-wide utilisation imply. When its cgroup is being throttled, adding
another IO thread cannot create CPU capacity and can instead drive
repeated, counterproductive scale-up decisions.

Resolve each process's cgroup v2 path, read its cpu.max quota and
cpu.stat throttle counters, and retain the latest sample on the
instance. The threshold engine can then hold scale-up whenever
throttled_usec increased since the preceding sample.

The first refresh always establishes an initial sample. The optional
refresh_cgroup_on_each_read setting refreshes quota and counters on
every tick when operators need runtime cgroup changes reflected
immediately; leaving it disabled avoids repeated filesystem reads for
stable production placement. Component-test configuration explicitly
disables both refresh and cgroup-based scale-up blocking where the fake
process does not model cgroups.

Signed-off-by: Thanos Makatos thanos.makatos@nutanix.com


Stack created with GitHub Stacks CLI • Give Feedback 💬

A VM process can have less CPU capacity than its vCPU count and
host-wide utilisation imply. When its cgroup is being throttled, adding
another IO thread cannot create CPU capacity and can instead drive
repeated, counterproductive scale-up decisions.

Resolve each process's cgroup v2 path, read its `cpu.max` quota and
`cpu.stat` throttle counters, and retain the latest sample on the
instance. The threshold engine can then hold scale-up whenever
`throttled_usec` increased since the preceding sample.

The first refresh always establishes an initial sample. The optional
`refresh_cgroup_on_each_read` setting refreshes quota and counters on
every tick when operators need runtime cgroup changes reflected
immediately; leaving it disabled avoids repeated filesystem reads for
stable production placement. Component-test configuration explicitly
disables both refresh and cgroup-based scale-up blocking where the fake
process does not model cgroups.

Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
@tmakatos
tmakatos added this pull request to stack #43 September 24, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant