Repository navigation
perf(io): tune MAP_POPULATE startup memory and optimize BatchUdpSocket burst sizing - #179
Merged
Merged
Conversation
vxfemboy
temporarily deployed
to
benchmark-approval
October 27, 2026 13:45 — with
GitHub Actions
Inactive
vxfemboy
temporarily deployed
to
benchmark-approval
October 27, 2026 13:45 — with
GitHub Actions
Inactive
vxfemboy
temporarily deployed
to
benchmark-approval
October 27, 2026 15:25 — with
GitHub Actions
Inactive
vxfemboy
temporarily deployed
to
benchmark-approval
October 27, 2026 15:25 — with
GitHub Actions
Inactive
This branch was previously 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.
Resolves #173
Summary
This PR addresses Issue #173 by:
Making
MAP_POPULATEconfigurable inUmemPool:UmemPoolConfigstruct controlling chunk count, chunk size, page pre-faulting (pre_fault: bool), and physical page locking (lock_memory: boolvialibc::mlock).UmemPool::new_lazyandUmemPool::with_configallowing on-demand page faulting, dropping initialization latency from 1,590.98 µs to 7.25 µs (219.5× faster startup) while reducing resident set size (RSS) on memory-constrained systems.UmemPool::new_slabs_with_configfor partitioned slabs.UmemPool::newpre-faulting for zero-jitter bare-metal deployments.bin/yipd/src/sharding.rsviaYIP_UMEM_LAZYandYIP_UMEM_MLOCK.Expanding
BatchUdpSocketSyscall Burst Sizing:recvmmsg_batch<const N: usize>andsendmmsg_burst<const N: usize>using const-generic stack allocations with 0 heap churn.BATCH_SIZE_64 = 64andBATCH_SIZE_128 = 128constants alongside defaultBATCH_SIZE = 32.sendmmsg_batchdelegating to 32-packet bursts for zero breaking changes.Multi-Region AWS WAN Benchmarking & Graph Updates:
us-east-1andus-west-2across baseline, Yip, WireGuard, and OpenVPN.crates/yip-bench/wan/results/best_of_3/wan.csvand updatedcrates/yip-bench/RESULTS.mdandREADME.md.assets/bench-throughput-loss.svgandassets/bench-fec-recovery.svg).Microbenchmark Results (
af_xdp_scale)MAP_POPULATE)new_lazy)Real-World AWS WAN Benchmarks (
us-east-1↔us-west-2, Best of 3)Two 1-vCPU Debian 13 VPSes, ~54.365 ms RTT apart, 2026-10-27.
Clean-Path Throughput & Latency
Loss Resilience (Injected Outer Egress Loss)
Verification
cargo test --workspace: All 391 unit + 98 integration tests pass cleanly.cargo clippy --workspace --all-targets -- -D warnings: 0 warnings, 0 errors.cargo fmt --check: 0 diffs.cargo shear: 0 unused dependencies.python3 crates/yip-bench/generate-graphs.py --check: OK.python3 crates/yip-bench/generate-wire-format.py --check: OK.pytest crates/yip-bench/: 16 passed in 0.17s.