Skip to content

Commit 7975cf3

Browse files
tilloclaude
andcommitted
monitoring/bpi-r4: split conntrack into 5-min cron + tune CronSlow
Walking /proc/net/nf_conntrack costs ~90s sys CPU at 30k+ entries due to kernel locking. Including it in the 1-min metrics-push.sh stacked cron runs (165s observed) and tripped BpiR4CronSlow. Producer side (deployed on bpi-r4): - new /usr/local/bin/conntrack-state-metrics.sh → job=bpi_r4_conntrack - cron */5 via timed-run.sh wrapper - state-breakdown + HW_OFFLOAD count removed from main metrics-push.sh Alert side: - BpiR4CronSlow now excludes script=conntrack-state-metrics - BpiR4ConntrackCronSlow new (threshold 240s for the 5-min cron) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent e430df8 commit 7975cf3

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

monitoring-rules/21-bpi-r4.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,11 @@ spec:
459459
rules:
460460
- alert: BpiR4CronSlow
461461
## Surfacing cron-script overruns. A minute-cadence script taking
462-
## > 30s burns 50% of its slot just on bookkeeping.
463-
expr: bpi_r4_cron_runtime_seconds > 30
462+
## > 30s burns 50% of its slot just on bookkeeping. conntrack-state-
463+
## metrics walks /proc/net/nf_conntrack which the kernel locks; at
464+
## 30k+ entries a single pass costs ~90s sys time, so it lives on a
465+
## 5-min cron and is excluded here — see BpiR4ConntrackCronSlow.
466+
expr: bpi_r4_cron_runtime_seconds{script!="conntrack-state-metrics"} > 30
464467
for: 10m
465468
labels: { severity: warning, team: mdapi, component: Internet }
466469
annotations:
@@ -470,6 +473,20 @@ spec:
470473
Check for proc-walking loops (busybox awk on /proc/net/nf_conntrack
471474
can hit 100s on a busy router; see the dropped flow-metrics.sh).
472475
476+
- alert: BpiR4ConntrackCronSlow
477+
## conntrack-state-metrics on a 5-min cron walks 30-50k entries —
478+
## ~90s at steady state. Alert if it overruns its slot (>240s = 80% of
479+
## interval), which usually means table runaway.
480+
expr: bpi_r4_cron_runtime_seconds{script="conntrack-state-metrics"} > 240
481+
for: 15m
482+
labels: { severity: warning, team: mdapi, component: Internet }
483+
annotations:
484+
summary: "BPI-R4 conntrack state metrics taking {{ $value }}s — table runaway?"
485+
description: |
486+
conntrack-state-metrics is exceeding 240s. Either nf_conntrack
487+
has grown past safe levels or PPE offload broke (everything
488+
falling back to slow path). Check bpi_r4_conntrack_count.
489+
473490
- name: app-bpi-r4.pushgateway-staleness
474491
## Detects total cron-daemon failure or network partition between router
475492
## and Pushgateway — local cron_last_completion_age can't catch this

0 commit comments

Comments
 (0)