Commit 69f176f
fix(monitoring): stop Loki high-memory false alerts from cgroup-v1 slab
The recurring HighPodMemoryUsage critical alert on bcgov-di-plg-loki-0 is
not real memory pressure. On the Silver cluster's cgroup v1 nodes,
container_memory_working_set_bytes includes reclaimable kernel slab
(dentry/inode caches). Loki's constant chunk create/delete churn inflates
that slab until it nears the 2Gi limit, while Loki's actual Go heap is only
~100Mi. The kernel reclaims the slab before any OOM, so the pod sits near
90% working-set indefinitely with zero restarts. Prior memory-limit bumps
could never fix this (slab just refills the larger limit), and cutting
chunk_idle_period to 5m made it worse by increasing file churn.
Two changes:
- prometheus-rule-crd.yaml: exclude the Loki pod from HighPodMemoryUsage
(working-set is a meaningless signal for it under cgroup v1). A real Loki
OOM is still caught by the PodInErrorState (OOMKilled) alert. All other
pods keep the early-warning alert.
- loki-configmap.yaml: raise chunk_idle_period 5m -> 1h, add explicit
max_chunk_age 2h, and enlarge chunk_target_size to 2Mi so Loki writes
far fewer chunk files, reducing the dentry/inode slab churn at its source.
Heap headroom (~100Mi of 2Gi) makes the longer idle period safe.
Documented the cgroup-v1 accounting artifact and the exclusion rationale in
docs-md/ALERTING.md. Structural fix is migrating nodes to cgroup v2.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0428d12 commit 69f176f
3 files changed
Lines changed: 36 additions & 6 deletions
File tree
- deployments/openshift/helm/plg/templates
- docs-md
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
30 | | - | |
| 38 | + | |
31 | 39 | | |
32 | | - | |
| 40 | + | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
100 | 116 | | |
101 | 117 | | |
102 | 118 | | |
| |||
0 commit comments