Skip to content

feat(web3): drop hugepages, fold the xmrig guard into monero - #4383

Closed
Tanguille wants to merge 10 commits into
feat/ci-lefthook-hooksfrom
feat/web3-guard-hugepages
Closed

feat(web3): drop hugepages, fold the xmrig guard into monero#4383
Tanguille wants to merge 10 commits into
feat/ci-lefthook-hooksfrom
feat/web3-guard-hugepages

Conversation

@Tanguille

Copy link
Copy Markdown
Owner

Stacked on #4381. 4th layer: #4378 <- #4379 <- #4381 <- this.

Hugepages

vm.nr_hugepages: 1184 withheld 2368Mi from every node's allocatable memory even at 0 replicas. xmrig has been 0/0 on all three nodes for 6d12h under the thermal guard; HugePages_Free == HugePages_Total and cluster-wide hugepages-2Mi requests were 0%.

node allocatable requested free now free after reclaim
control-2 22271Mi 22250Mi 21Mi 2389Mi
control-3 22271Mi 22266Mi 5Mi 2373Mi

Unblocks rook-ceph-exporter-control-2 (150Mi, Pending 2h).

Applies on next reboot. Nothing was applied to the cluster.

Coupled edits required by the removal: --huge-pages -> --no-huge-pages, both hugepages-2Mi blocks, the HugePages emptyDir, and IPC_LOCK (xmrig takes it only to raise RLIMIT_MEMLOCK for MAP_HUGETLB).

xmrig memory 32Mi/128Mi -> 2Gi/3Gi. Requested under the ~2336Mi RandomX needs: at the true figure the miner never schedules and preemptionPolicy: Never means it waits rather than preempts. /tmp gains sizeLimit: 64Mi because the dataset now shares the container limit instead of living in hugetlb.

Net reclaim is 2368Mi idle, ~320Mi while mining. RandomX loses hashrate without hugepages; accepted.

Guard move

web3/xmrig-guard/app/ -> web3/monero/guard/, standalone ks.yaml folded into monero/ks.yaml. Resources renamed to guard.

Metrics stay xmrig_guard_*. The KEDA triggers, 5 alert rules, the dashboard and 180d of series reference them.

No dependsOn added: KEDA's fallback: {failureThreshold: 1, replicas: 0} plus the count == bool 1 and timestamp >= time() - 120 gates mean an absent guard yields 0 replicas, so ordering cannot produce mining without a gate.

Tuning

Replayed 180d of node_hwmon_temp_celsius at the native 20s cadence over a 612-candidate grid. Only 2026-07-27 14:02 onward reflects the deployed policy; before that the guard read all sensors rather than temp1 (~9C hotter), and 07-17..21 it emitted without enforcing.

parameter before after evidence
recovery dwell 300s 180s +0.8pp/+1.1pp over 30d, no change in exposure above 65C
panic 68C 67C 0.0pp cost, caps hottest safe sample 67.8 -> 66.8C
recover / trip / trip_dwell 62 / 65 / 60 unchanged held against the grid

Nothing loosened. Measured bursts peak at p50 67.8 / p90 68.8 / max 69.8C against a 70C rating. Rise is p50 0.88 / p90 1.13 / p99 1.35 C/min, not the 1.1 the design was sized on; the budget test now uses 1.35 and pins the panic path, which governs on a fast ramp (68.69C at 75s) since the trip path models 68.04C above the panic limit.

Guard is working: zero samples >=70C while safe=1. Before it existed, ungated mining put control-3 over its rating 51% of the time it mined, peaking at 86C.

The prior 55.0%/38.8% vs 44.7%/31.5% figures do not reproduce on either sensor set. Direction holds, magnitudes were stale; restated in the doc.

control-1 freshness

Flapping was telemetry, not policy: 465 query errors in 10.26d against 45 and 49 on the NVMe nodes, source_age_seconds p99 102s against a 120s ceiling. cadvisor scrapes at 60s where the other six sources scrape at 20s and query_cpu dates the observation by min() across them. Self-reinforcing at 1.7 errors/h idle vs 4.8/h with a miner, because the cadvisor join only engages when one is present. 85 of 118 mining bursts died under 5 minutes.

Budget is now 180s for the CPU path, carried on the policy so the freshness check, anti-replay gap and dwell reset read one number and cannot drift. VM step follows, or the samples would never be returned. Its thresholds replay at 93.8% safe against 75.8% observed.

Follow-ups, not in this PR

  • evictionHard: 7% -> 1Gi and systemReserved: 1Gi -> 512Mi: another +1.54Gi/node. kubeReserved must NOT be cut, measured /podruntime is already above its 2Gi.
  • The nvme1 Micron 7450 480GB runs ~10C hotter than the 980 PRO beside it and sets the gate on both nodes. Sun-hour idle baseline is 63-64C against a workload adding 8.5C in 7 min, so 68-72% of surplus goes unmined. Cooling it beats any threshold change.

Verification

26/26 tests pass; kustomize build clean on web3, monero/guard, monero/xmrig, cnpg cluster.

renovate Bot and others added 9 commits August 6, 2026 21:13
…ctoria-metrics-k8s-stack (0.89.0 ➔ 0.90.0) (#4380)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
48 slots (16x concurrency ratio) was a guess; 14d telemetry shows slots
hit 32 in 0.055% of samples and never higher. Capping at 32 frees 16
slots (~1.2G) back to the shared byte budget for KV cache headroom.
v2.2.0 adds review_verbosity, which patches the bundled prompt with a
~300-word target and moves minor/info out of prose into the findings
array. The hand-written "keep review length proportional" rule in the
system_prompt addendum now duplicates it, so drop it.
Upstream #426 landed in v2.1.11: system_prompt_file and system_prompt are
concatenated (file first, inline second) instead of the file being silently
dropped. The standing rules move to .github/pr-review-prompt.md, leaving the
scalar to hold only the per-PR release-notes branch.
tool_evidence_memory is on by default and seeds a corpus section telling the
model to reuse prior evidence instead of re-gathering. The addendum is appended
after the bundled default, so "cite only sources fetched this run" overrode it
and forced a re-fetch every incremental review. Narrow the rule to the failure
it was written for: claiming "confirmed" for a source that was never read.
…lumbing

42 of the last 83 reviews stopped at exactly the default 4 tool calls and none
exceeded it, so the call budget bound every second review while the 900s wall
clock went unspent. All 20 run_command calls in that sample were git_diff_stat,
git_diff_name_only or git_status_short, re-deriving a diff the corpus already
carries; on #4370 that was half the budget, and the review then called an
unterminated regex correct without ever opening .renovaterc.json5.
PR #4349 emitted "Release notes: no release notes apply" and "Tool Harness
Findings: the tool loop issued no tool calls" on a two-file Ceph change. The
release-notes instruction fired on every PR regardless of whether anything was
bumped; gate it on a version change and tell the reviewer to drop empty sections.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a6d0323-a040-450e-8f29-b0172e390e55

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@deepsource-io

deepsource-io Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

DeepSource Code Review

We reviewed changes in e8b5832...f2e1c58 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Aug 6, 2026 9:43p.m. Review ↗
Shell Aug 6, 2026 9:43p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

vm.nr_hugepages withheld 2368Mi from every node's allocatable memory even
at 0 replicas, while control-2/3 sat at 99% booked with a 150Mi exporter
Pending. Drop the sysctl and move xmrig to regular pages.

xmrig requests 2Gi against the ~2336Mi RandomX needs: post-reclaim headroom
is 2389Mi/2373Mi, and the true figure parks the miner Pending forever behind
preemptionPolicy: Never. /tmp gains a sizeLimit since the dataset now shares
the container's memory limit rather than living in hugetlb.

Move xmrig-guard to monero/guard and rename its resources. Metrics stay
xmrig_guard_* : the KEDA triggers, five alerts, the dashboard and 180d of
series all reference them.

Tuning, replayed over 180d at the native 20s cadence:
- recovery dwell 300->180s, +0.8pp/+1.1pp over 30d, no change above 65C
- panic 68->67C, zero measured cost, caps the hottest safe sample at 66.8C
- recover 62 / trip 65 / trip_dwell 60 held against a 612-candidate grid

Nothing is loosened: real bursts peak at 69.8C against a 70C rating, and
the rise is p99 1.35C/min, not the 1.1 the design was sized on.

control-1's flapping was telemetry, not policy. cadvisor scrapes at 60s
where the other six sources scrape at 20s and query_cpu dates the
observation by min() across them, so it self-invalidated 465 times in
10.26d against 45 and 49 on the NVMe nodes, each latching a 600s recovery
dwell. Its budget is now 180s and carried on the policy, so the freshness
check, the anti-replay gap and the dwell reset cannot drift apart; the VM
step follows or the samples would never be returned.
@Tanguille
Tanguille force-pushed the feat/web3-guard-hugepages branch from 15a3c13 to f2e1c58 Compare August 6, 2026 21:43
@Tanguille

Copy link
Copy Markdown
Owner Author

Recreating against main: GitHub refuses to retarget this PR because it was opened as part of a stack under #4381, which is now closed as superseded. The branch content is unchanged and already rebased onto main.

@Tanguille Tanguille closed this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant