Skip to content

containerd-shim-runc-v2: accelerating CPU time growth on long-running nodes with stable workloads #13558

Open

Description

@jabhishek87

Description

We are observing continuous, monotonically increasing CPU time consumption in containerd-shim-runc-v2 processes on long-running Kubernetes nodes. The issue is reproduced on both containerd v1.7.27 and v2.0.7.

Over a 14-day observation window on containerd v2.0.7, the aggregate CPU TIME+ of 58 containerd-shim processes grows with positive acceleration — each day gains more CPU time than the previous day. This is not a constant overhead; it is accelerating.

The growth is uniform across all shim instances regardless of the workload type they manage, suggesting a systematic issue within the shim runtime itself.

Environment:

  • OS: Debian 12 (Bookworm), kernel 6.6.x
  • Architecture: x86_64 (Intel Xeon, 16 cores)
  • Kubernetes: v1.29
  • Container runtime: containerd v2.0.7 (also reproduced on v1.7.27)
  • cgroup version: v2

Correlation with memory growth:
The same shim processes also exhibit RSS memory growth over the same period (see #12600, #12738). However, the CPU growth appears to be a distinct symptom — it follows its own linear acceleration pattern independent of memory pressure.

Steps to reproduce the issue

  1. Deploy a single-node Kubernetes cluster with containerd v2.0.7
  2. Run a stable set of ~50-60 long-lived pods (e.g., calico, monitoring stack with elasticsearch/kafka/filebeat/metricbeat, application pods)
  3. Do NOT restart any pods or perform scaling — keep the workload completely static
  4. Capture per-process CPU TIME+ daily using top -b -n1 or equivalent
  5. After 14+ days, plot the daily CPU TIME+ gain for each containerd-shim-runc-v2 process
  6. Observe that the daily gain increases each day (positive acceleration)

Describe the results you received and expected

Expected behavior

For a stable set of long-lived containers with constant workloads, containerd-shim CPU consumption should remain roughly constant over time. The daily CPU TIME+ gain should be flat (no acceleration).

Actual behavior

Every containerd-shim-runc-v2 process accumulates more CPU time each successive day. The growth is not linear — it is accelerating.

Aggregate daily CPU TIME+ gain (hours) for all 58 shim processes:

Day: 02 03 04 05 06 07 08 09 10 11 12 13 14 15
Gain: 2.00 2.04 2.09 2.14 2.18 2.23 2.28 2.33 2.37 2.43 2.47 2.53 2.58 2.63

Per-shim breakdown (representative samples, daily CPU hours gained):

Shim (container) Day 02 Day 08 Day 15 Trend
calico-kube-controllers 0.18 0.22 0.27 ▲
calico-node 0.17 0.20 0.25 ▲
filebeat 0.14 0.16 0.20 ▲
metricbeat 0.13 0.15 0.19 ▲
elasticsearch 0.09 0.11 0.13 ▲
kafka-controller 0.09 0.11 0.13 ▲
kafka-broker 0.08 0.10 0.12 ▲
kibana 0.08 0.09 0.11 ▲

Cross-version comparison:

Metric containerd v1.7.27 (56 shims, 31 days) containerd v2.0.7 (58 shims, 14 days)
CPU acceleration +0.020 h/day² +0.048 h/day²

v2.0.7 is growing 2.4× faster than v1.7.27.

What version of containerd are you using?

containerd v2.0.7

Any other relevant information

Show configuration if it is related to CRI plugin.

Default containerd configuration:

toml
version = 3

[plugins."io.containerd.cri.v1.runtime"]
[plugins."io.containerd.cri.v1.runtime".containerd]
default_runtime_name = "runc"
[plugins."io.containerd.cri.v1.runtime".containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"

No custom shim options or runtime configurations.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions