Commit 38b8ea9
fix: cap startup memory to avoid OOMKill on rollout (#161)
compute-manager was OOMKilled during startup after a rollout restart on
prod: concurrent informer/cache sync across all project control planes
briefly overshot the 1500Mi cgroup limit before the Go GC caught up. The
Go runtime had no awareness of the cgroup limit and steady-state working
set stays well under it, so this was a startup allocation spike, not a leak.
Two mitigations:
- Set GOMEMLIMIT from the cgroup (via automemlimit, ratio 0.9) so the GC
backpressures before the kernel OOMKills the process. No-op when
GOMEMLIMIT is already set in the environment (an explicit manifest
override wins) or when off-cgroup (local dev).
- Strip managedFields from every controller cache (DefaultTransform =
cache.TransformStripManagedFields()) across the deployment cluster, the
main multicluster manager, the discovery manager (unstructured, where
managedFields are heaviest), the per-project clusters that fan in at
startup, and the federation manager. managedFields are server-side apply
bookkeeping the controllers never read.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7f880e5 commit 38b8ea9
3 files changed
Lines changed: 42 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
139 | 156 | | |
140 | 157 | | |
141 | 158 | | |
| |||
193 | 210 | | |
194 | 211 | | |
195 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
196 | 218 | | |
197 | 219 | | |
198 | 220 | | |
| |||
230 | 252 | | |
231 | 253 | | |
232 | 254 | | |
| 255 | + | |
233 | 256 | | |
234 | 257 | | |
235 | 258 | | |
| |||
405 | 428 | | |
406 | 429 | | |
407 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
408 | 437 | | |
409 | 438 | | |
410 | 439 | | |
| |||
419 | 448 | | |
420 | 449 | | |
421 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
422 | 456 | | |
423 | 457 | | |
424 | 458 | | |
| |||
486 | 520 | | |
487 | 521 | | |
488 | 522 | | |
| 523 | + | |
489 | 524 | | |
490 | 525 | | |
491 | 526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| 112 | + | |
| 113 | + | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| |||
0 commit comments