Skip to content

feat(k8s): measure runsc against runc for RuntimeClass gvisor #5434

Closed

Description

@dan-petty

Problem or Motivation

RuntimeClass gvisor (#5431) has no overhead.podFixed, and nobody measured runsc against runc on the cluster. Open gVisor issue gvisor/gvisor#13777 reports that the CPU and memory limits of a pod do not hold under containerd 2.2 with systemd-cgroup. The nodes run containerd 2.3.7. Before the planner run Job (#4003), the in-cluster browser (#5356) or a runner Job sets runtimeClassName: gvisor, a measurement must show that the limits hold, and it must give the overhead of the sandbox.

The parent #2695 records on 2026-11-05: "Rejected: gVisor or Kata through a RuntimeClass". #5431 records the owner decision of 2026-11-13 to use gVisor (runsc). This item is the gate of that decision: no workload uses the class before this item is done.

Proposed Solution

Run a measurement after the infra repository installs runsc on one agent node and sets the node label node-restriction.kubernetes.io/gvisor=true:

  1. Pin both arms to the one labelled agent node with a kubernetes.io/hostname node selector. Without it, the runc arm can go to the control-plane node, which has 48 CPUs.
  2. Use one image by digest, and pull it on the node before the first timed run.
  3. Do at least 5 runs of each arm, interleaved, and drop the first run of each arm. Record the load of the node (the GPU and model pods on it) at each run.
  4. Measure the time from pod create to Ready and to completion, a CPU-bound task, a task with much file I/O (a git clone and a pytest run in the runner image), and the memory.
  5. Prove the limits in both arms: a CPU limit must throttle (container_cpu_cfs_throttled_periods_total, or the wall time), and an allocation above the memory limit must end in OOMKilled.
  6. Get overhead.podFixed from the memory of the pod cgroup minus the working set of the container under runsc.
  7. Read the results from the Job logs (JSON on stdout) and from Prometheus. Do not use kubectl exec.
  8. Run in a dedicated namespace with a ResourceQuota, activeDeadlineSeconds and ttlSecondsAfterFinished, and delete the namespace at the end.
  9. Start Chromium with --headless in the runsc arm (the smoke test of feat(k8s): run a pinned Playwright browser server in namespace devops #5356).
  10. Say whether results from an agent node apply to the control-plane node that runs the runner Jobs, because that node has no runsc.

Then set overhead.podFixed in k8s/runtimeclass-gvisor.yaml, pin it with a test, and record the results in k8s/README.md.

Acceptance Criteria

Existing Tool Considered

kubectl, Kubernetes Jobs and the cAdvisor metrics in Prometheus cover the measurement. It needs no new tool.

Source: #2695

Activity

  1. added
    source/agent
    on Nov 13, 2026
  2. added
    type/feature
    scope/k8s
    status/new
    value/medium
    effort/medium
    on Nov 13, 2026
  3. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 13, 2026
  5. added
    owner/agent
    on Nov 13, 2026
  6. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    Measurement result: runc and runsc on the gVisor node (2026-11-13 17:29Z to 17:48Z)

    Method: one test namespace with interleaved runc and runsc Jobs of the runner image on the node with the label node-restriction.kubernetes.io/gvisor=true. A runsc canary ran first and reported kernel 4.19.0-gvisor, so the sandbox applied. Each table value is the median (min-max), with the first run of cpu, fs and chromium left out. The namespace was deleted at the end.

    Workload runc runsc Result
    cpu (Python loop), 5 runs 1.4 s 1.4 s no CPU overhead
    fs (file create, write, read, delete), 5 runs 9.4 s (9.3-10.5) 13.5 s (13.2-14.7) 1.44 times slower
    mem (512 MiB held 60 s), 3 runs pod working set - RSS = -7.7 MiB +7.4 MiB about 15 MiB fixed overhead for each pod
    cpulimit (cpu workload, limit 500m), 3 runs 4.0 s (2.9 times cpu) 3.6 s (2.6 times cpu) the CPU limit holds under runsc; the gVisor #13777 risk did not occur with systemd-cgroup=true
    oom (allocate past a 224 MiB limit) OOMKilled, exit 137 OOMKilled, exit 137 the memory limit holds
    chromium (headless page load), 3 runs 0.7 s (0.5-0.9) 1.4 s (1.4-1.4) works; 2 times slower on a short task
    Job to pod start about 1 s about 1 s no start overhead

    Limit of the measurement: the script did not read the CFS throttled-period counter (the column is empty for both arms). The slowdown of more than 2 times proves that the limit holds. It does not give the throttle count.

    What follows

    • overhead.podFixed of RuntimeClass gvisor: memory 16Mi (the measured 15.1 MiB, rounded up). No CPU overhead was measured, so the RuntimeClass sets no CPU overhead. This goes in a small PR for this issue.
    • Fit: the runner workloads (git, pytest, ruff) are file-heavy, so expect them to be up to 1.44 times slower in file work. CPU-bound work has no cost. The browser works under runsc.
    • Next, under the docs(security): when a control changes for a dev resource or sandbox #5447 policy: propose the first sandbox entry. Inside RuntimeClass gvisor pods, the runner command allow list gets wider. The compensating controls are the sandbox, the no-egress NetworkPolicy and the namespace with no Secret. The owner approves the entry.
  7. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 13, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 13, 2026
  9. devops-cli-service commented on Nov 13, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-13 20:55 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/k8ssource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions