perf: reduce TAP framer per-packet I/O #465
No reviewers
Labels
No labels
Compat/Breaking
Component/Enclave-Builder
Component/Infrastructure
Deploy/BYOC
Deploy/Full-managed
Deploy/Self-hosted
Interface/API
Interface/CLI
Interface/Git
Interface/Web
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
Reviewed/Confirmed
Reviewed/Duplicate
Reviewed/Invalid
Reviewed/Won't Fix
Status/Abandoned
Status/Blocked
Status/Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
public/platform!465
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf/tap-framer-io"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Stacked on #464, targeting
fix/tap-vsock-framing, notmain.BufReader, amortizing stream reads without changing the four-byte wire format, frame bounds, one-write-per-TAP-packet rule, synchronous TAP startup, or independent duplex workers.write framefor the combined operation; underlying errors still propagate.Base:
a12a7f0f2a1c5ef4bbc321825fb298aa7fde82cb.Candidate:
028031cabbdc6a2b5c20f74d2842128b27d02287.Tested/reviewed tree:
2a70372093d180c2532f772ba637221b70fc3148.Measured local performance — not Nitro
Two real TAPs in separate, owned user/network namespaces, real TCP, AF_UNIX replacing vsock, pinned production-build static helpers. MTU 1500; 512 MiB per direction; five interleaved repetitions; both mixed old/new pairings. All 24 GiB of bulk payload passed byte-count/SHA-256 and EOF checks. All owned process groups were removed; parent interfaces were unchanged.
These are local comparison results, not native-vsock capacity, internet transfer rates, or promised production gains. Python endpoints, hashing, kernel TCP, backpressure and uncontrolled host scheduling contribute. CPU is both helper processes' user+system time per delivered GiB, excluding endpoints.
A separate release-mode socket microbenchmark verified 60 samples / 8.2 million frames against unchanged production functions: send throughput +33–34%, receive throughput +122–134%; bulk forwarding CPU/frame down about 25% and 55–57%, respectively. It uses a datagram TAP surrogate, not real TAP.
Limitations / counter-evidence:
ENODEV). No new Nitro deployment or native-vsock performance validation was performed. Production gains require a separate matched managed-Nitro comparison using the established dev workflow.Test plan and results
make test-unit, invoked via/tmp/tap-framer-io-evidence/regular_tests.pywith a fresh, disposable PostgreSQL 17 container and cloud credentials removed: 910 passed, 0 failed, 3 ignored. Test container removed and absence verified.make test-cli-install: passed.RUSTUP_TOOLCHAIN=1.96.1 CARGO_TARGET_DIR=/tmp/platform-tap-framer-target make test-tap-framer: 8 passed against the normal binary.unshare --user --map-root-user --net python3 tests/test_tap_framer.py /tmp/tap-framer-io-evidence/static/tap-framer: 8 passed against the pinned static binary.cargo fmt --manifest-path src/enclave-builder/templates/tap-framer/Cargo.toml -- --checkandcargo clippy --locked --manifest-path src/enclave-builder/templates/tap-framer/Cargo.toml --all-targets -- -D warnings, both withRUSTUP_TOOLCHAIN=1.96.1: passed.tap-framer-builderstage exported with Docker BuildKit for both immutable source snapshots. Contexts compared byte-for-byte to Git. Rebuilt baseline matches the prior framing-fix static artifact; benchmark source/executable hashes and raw logs independently verified.git diff --checkpassed. Local merge-tree against the actual base equals the tested tree.Reproducible benchmark runners, raw samples, production build contexts, artifact checksums and review are provided in the attached evidence archive. Its README contains the exact benchmark/build commands. Hostnames were omitted from public metadata; no credentials or production inputs are included.
Merge/review verdict: small, validated performance change on top of #464. Production verdict: not deployed; native-vsock/Nitro qualification remains separate. No issue auto-close directive is appropriate for this user-requested optimization.
Reproducible evidence
Download benchmark evidence (
tap-framer-io-028031c-evidence.zip, 163,853 bytes).SHA-256:
6584f0565c689f69aa8bc853eeea986fae7a02587cc429104a6804e97251a1ce. Uploaded asset was downloaded and checksum-verified.Closing as incorporated into #464 at
5cd86be51695f60f9c76015f2d5211f9d77775f0. That PR now contains this optimization and its regression tests, together with the matching reviewed host-helper checksum pin. Verified the helper source matches this PR byte-for-byte after relocation tosrc/tap-framer/.This is a superseded-PR closure, not a merge into
main; #464 remains open. The source branch is retained.Pull request closed