feat: persist OS tuning across reboots (sysctl.d + boot tuning unit)#56
Merged
Conversation
…(match#48) Runtime-only sysctls reverting on reboot is the root of the 2026-07-03 corruption chain: rmem_max/wmem_max fell back to 212992, the C media drivers crash-looped on SO_RCVBUF validation, nodes started against absent drivers, and the kill-mid-write cycle corrupted node0's archive segment (match#35 replay hot-loop). - system-tuning.sh --persist (make tune-persist): writes the full sysctl set (transport-critical + optimize-os) to /etc/sysctl.d/99-openexchange.conf, skipping keys absent on the running kernel, and installs+enables openexchange-tuning.service (oneshot) for the two non-sysctl knobs: THP=never and performance governor. - --report now shows runtime-vs-persisted drift per key and the boot unit's enablement, so `make tune-report` catches divergence after kernel upgrades. Persist paths are env-overridable for tests. - make optimize-os runs the persistence step at the end. - Runbook + production checklist updated (verify with make tune-report after reboots/kernel upgrades, before starting drivers/nodes). Closes #48 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48 (P1.4, v0.3.0-beta).
Problem
system-tuning.sh/make optimize-oswrote runtime sysctls only. After the 2026-07-03 reboot,net.core.rmem_max/wmem_maxreverted to 212992, the C media drivers crash-looped on SO_RCVBUF validation, the process manager kept starting nodes against absent drivers, and the kill-mid-write cycle corrupted node0's archive segment (the #35 replay hot-loop). Every reboot recreates this unless someone remembers to re-tune.Changes
system-tuning.sh --persist(newmake tune-persist):optimize-osset) to/etc/sysctl.d/99-openexchange.conf, commenting out keys absent on the running kernel (e.g. the pre-EEVDFkernel.sched_*knobs on 6.x), and applies it immediately so runtime == boot stateopenexchange-tuning.service, a oneshot boot unit for the two non-sysctl knobs: THP=never and performance governor--reportdrift detection: shows each persisted key that diverges from the runtime value, plus the boot unit's enablement, somake tune-reportcatches kernel upgrades / manual changesmake optimize-osnow runs the persistence step at the end.claude/CLAUDE.md) + production checklist (docs/kernel-bypass.md) updatedVerification
tcp_rmemconfirmed)installto /etc,systemctl enable) need a privileged run on the box:sudo make tune-persist. Exit criterion (clean reboot with zero manual steps) verifiable at the next reboot viamake tune-report.🤖 Generated with Claude Code