Repository navigation
Description
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
- Deploy a single-node Kubernetes cluster with containerd v2.0.7
- Run a stable set of ~50-60 long-lived pods (e.g., calico, monitoring stack with elasticsearch/kafka/filebeat/metricbeat, application pods)
- Do NOT restart any pods or perform scaling — keep the workload completely static
- Capture per-process CPU TIME+ daily using
top -b -n1or equivalent - After 14+ days, plot the daily CPU TIME+ gain for each containerd-shim-runc-v2 process
- 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
- No pod churn — all containers are long-lived and stable throughout the observation
- The acceleration pattern is uniform across all shims, suggesting something internal to the shim (e.g., goroutine accumulation, polling frequency increase, internal bookkeeping scaling with uptime)
- The system also exhibits containerd-shim RSS memory growth (related: Shim leak and stale container state if containerd restarts during a StopContainer operation #12600, Continuous memory growth in containerd v2.1.4 #12738), but the CPU symptom appears to be independent
- After ~28 days, total platform CPU usage exceeds 95% threshold purely due to shim overhead growth
- Restarting the node resets the pattern; it begins growing again immediately from baseline
- This may be related to Shim leak and stale container state if containerd restarts during a StopContainer operation #12600 if the memory leak causes increased GC pressure, but the linear acceleration pattern suggests something more systematic
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
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
oom: read full memory.events to avoid missing oom_kill on truncation
oom: avoid per-wakeup allocations in cgroup v2 OOM watcher
oom: read full memory.events to avoid missing oom_kill on truncation
oom: avoid per-wakeup allocations in cgroup v2 OOM watcher
oom: read full memory.events to avoid missing oom_kill on truncation