Add inspection for cgroup v2 CPU quota and period

Open
#377 0 comments 0 reactions 0 assignees View on GitHub

@linrl3 is already working on this.

Since Oct 22, 2026.

  • #401 by @linrl3 — closed without merging
  • #404 by @linrl3 — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go, linux

Research direction

Start with cgroup2/cpu.go at line 56 and cgroup2/manager.go at line 953, then inspect the current public API and README discussion of cgroup inspection. Define how CPU quota and period should be exposed to a Go application running in a CPU-limited container, and consider the work done when callers can retrieve both values through the public API.

Written by the indexing model from the issue text.

Description

I see this function, and essentially, I want to somehow use it in a Go application that runs inside a cpu-limited container so the app can understand its environment better:

https://github.com/containerd/cgroups/blob/f1e92d84a45c1c1ae283505f5b680156687ef2f0/cgroup2/cpu.go#L56

https://github.com/containerd/cgroups/blob/f1e92d84a45c1c1ae283505f5b680156687ef2f0/cgroup2/manager.go#L953

I don't see any way to get at this information from the current public API.


Is this something that would make sense to include in this module? The readme says "inspecting" cgroups is one of its goals, so my guess is that it would be a good feature.

Dominant language
Go
Stars
1.2k
Forks
255
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from containerd/cgroups

All issues in containerd/cgroups

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.