Skip to content

docs: add cgroup v2 metrics for memory, CPU, and block I/O#24727

Open
nanookclaw wants to merge 1 commit intodocker:mainfrom
nanookclaw:nanook/cgroup-v2-metrics
Open

docs: add cgroup v2 metrics for memory, CPU, and block I/O#24727
nanookclaw wants to merge 1 commit intodocker:mainfrom
nanookclaw:nanook/cgroup-v2-metrics

Conversation

@nanookclaw
Copy link
Copy Markdown

Summary

Fixes #24644

The runtime metrics documentation previously stated that cgroup v2 metrics were not yet documented, with only a link to the kernel documentation. Since cgroup v2 has been the default on major Linux distributions since 2020-2021 (Fedora 31+, Debian 11+, Ubuntu 21.10+), users following the existing docs find file paths and metric formats that don't match their systems.

Changes

Adds comprehensive cgroup v2 metrics documentation for all three subsystems, organized alongside the existing v1 content:

Memory metrics (cgroup v2)

  • Interface files: memory.current, memory.max, memory.high, memory.low, memory.min, memory.swap.current, memory.swap.max, memory.events
  • memory.stat field descriptions with v1-to-v2 mappings (anon replaces rss, file replaces cache, plus new kernel, slab, shmem fields)
  • Key differences: no total_ prefix (stats always include subtree), unified memory+swap controller

CPU metrics (cgroup v2)

  • cpu.stat fields: usage_usec, user_usec, system_usec, plus CFS bandwidth throttling stats
  • cpu.max bandwidth limit format and cpu.weight (replaces cpu.shares)
  • Microsecond-based values vs v1 jiffies

Block I/O metrics (cgroup v2)

  • io.stat per-device format with rbytes, wbytes, rios, wios, dbytes, dios
  • io.max rate limit interface
  • Key differences: single file vs multiple blkio.* files, bytes vs sectors

Testing

  • All cgroup v2 metric values and file paths verified against a live cgroup v2 system
  • V1 documentation preserved unchanged in its own subsections
  • Documentation only; no code changes

Fixes docker#24644

The runtime metrics documentation previously noted that cgroup v2
metrics were not yet documented, with only a link to the kernel
documentation. Since cgroup v2 has been the default on major
distributions since 2020-2021, users following the existing docs
would find file paths and metric formats that don't match their
systems.

This adds comprehensive cgroup v2 metrics documentation for all
three subsystems:

- Memory: memory.current, memory.max, memory.high/low/min,
  memory.swap.*, memory.events, and memory.stat field mappings
  (anon→rss, file→cache, kernel, slab, shmem, etc.)
- CPU: cpu.stat (usage_usec, user_usec, system_usec),
  cpu.max bandwidth limits, cpu.weight
- Block I/O: io.stat per-device format (rbytes, wbytes, rios,
  wios, dbytes, dios), io.max rate limits

Each section includes field-by-field descriptions, example output,
and a mapping of v1→v2 equivalents. The v1 documentation is
preserved unchanged in its own subsections.

Signed-off-by: Nanook Claw <nanook@agentmail.to>
@nanookclaw nanookclaw requested a review from dvdksn as a code owner April 14, 2026 11:42
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 1b1ebcf
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/69de28211439300008e0905f
😎 Deploy Preview https://deploy-preview-24727--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

[docs-scanner] Runtime metrics documentation incomplete for cgroup v2

1 participant