Repository navigation
perf(wasix): reduce initdb latency with private initialization - #246
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
f0rr0
marked this pull request as ready for review
October 4, 2026 15:50
This was referenced Oct 4, 2026
This branch was successfully deployed
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.
Summary
Fresh directory startup spends roughly 5–6 seconds initializing catalogs directly on the host filesystem, including repeated syncs of intermediate files. Initialize the unpublished cluster in private memory, then copy the complete PGDATA tree, including WAL, into private staging inside the managed root and publish it through the existing checked durability barriers and rename protocol.
Use four bounded workers for copy and file sync, plus an optional Linux writeback hint before the checked barriers. Bootstrap uses 8MB shared buffers and
--no-synconly in private memory; restore the 128MB serving default before publication. The measured directory configuration uses the default serving settings:fsync=on,full_page_writes=on, andsynchronous_commit=on. Existing caller startup GUCs, includingfsyncand buffer overrides, continue to apply to serving. Reuse the existing private permission helpers (0700 directories, 0600 files), runtime-directory setup, and publication cleanup/error handling. Online backup retains its separate WAL capture behavior.Routing caller durability settings consistently through WASIX preparation, publication, and serving remains a separate follow-up. #241 covers native startup defaults. This diff retains the existing checked publication barriers, including when a caller selects
fsync=offfor serving; that remaining lifecycle inconsistency is not fixed here. The temporary private bootstrap settings do not replace caller-selected serving settings.Measured startup
Optimized standalone Node addon on Linux x86_64/ext4, Node 24.18.0, warm SDK/OS caches, separate processes, no overlapping builds.
Oliphaunt.opentiming excludes import and explicit seed archive reads; every sample also queried and closed successfully.Fresh directory samples ranged from 927–1,152ms. This substantially improves the original startup, but the fresh-start median still exceeds the under-one-second target. The latency target and full release qualification remain unresolved.
Release Intent
perf:. The shared Rust WASIX implementation also serves the Node SDK.Verification
Moon affected checks and tests passed: Rust formatting, lint, owner tests and package; NAPI Rust formatting/lint, typecheck and tests. All 12 tasks including prerequisites passed, covering 154 Rust library tests, eight public API tests, doctests, five NAPI unit tests, and package/provenance checks.
Product-specific smoke/package/perf checks: 19 real consumer tests covering fresh/seeded memory and directory storage, reopening, persistence, backup/restore, transaction recovery, async admission/close, standard/ICU resources, seed rejection, serving settings and buffer overrides.
Six injected EIO publication cases (fresh/seeded file, staging-directory and post-rename parent barriers) failed cleanly and retried on the same root. Unsupported Linux writeback hints also succeeded through the checked sync fallback. This is error-path testing, not physical power-loss testing.
CI changes passed
ci-workflows:check, including pinned actionlint 1.7.12 and zizmor 1.25.2, workflow security, gate behavior, 70 planning tests and 10 transfer/gate regressions. CI workflow and tooling formatting/lint checks also passed.Local qualification used the reviewed implementation at
3070117e. Rebased onto main after #245 merged;git range-diffconfirms all three startup patches are identical, and all four implementation file hashes match the qualification receipt.git diff --checkpasses. Packaging fixes are already in main and are excluded from this diff.Full release addon/carrier and exact-head hosted/platform qualification remain incomplete. The previous CI failure came from skipped selected producers and WASIX aggregates accepting skipped host builds. This update explicitly requires successful planning, Checks and Tests results for source producers and successful selected hosts for WASIX aggregates. Hosted qualification of the updated head is pending. Local runtime/performance evidence uses an optimized standalone candidate; it does not establish full release readiness.