mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #65] [MERGED] perf: stabilize concurrent snapshot resume #150
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#150
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/65
Author: @yingdi-shan
Created: 7/29/2026
Status: ✅ Merged
Merged: 7/31/2026
Merged by: @yingdi-shan
Base:
main← Head:fix/firecracker-spawn-pre-exec📝 Commits (1)
fcbd5a4perf: stabilize concurrent snapshot resume📊 Changes
8 files changed (+496 additions, -145 deletions)
View changed files
📝
crates/benchmarks/benches/snapshot_benchmark.rs(+56 -23)📝
crates/warm-pool/src/lib.rs(+61 -7)📝
src/privileges.rs(+238 -19)📝
src/sandbox/envd.rs(+53 -4)📝
src/sandbox/firecracker/instance.rs(+24 -25)📝
src/sandbox/network/iptables_util.rs(+26 -29)📝
src/sandbox/network/manager.rs(+6 -6)📝
src/sandbox/network/slot.rs(+32 -32)📄 Description
What
Stabilize high-concurrency snapshot resume by removing
pre_exechooks from Firecracker and privileged network command launches.Also harden envd readiness checks, make warm-pool misses drive adaptive refill, and improve the concurrent resume benchmark warm-up and diagnostics.
Why
Firecracker currently uses
pre_exechooks to enter its network namespace and drop capabilities. These hooks make RustCommandineligible for theposix_spawnfast path, forcing every launch throughfork+exec.AgentENV is a large, multithreaded process. Although
forkuses copy-on-write, it must still duplicate process metadata and page tables. Starting 50 Firecracker processes concurrently amplifies that work and creates substantial contention and tail latency before the children reachexec.Network slot reuse introduces two additional sources of variance:
Measured with
make bench-snapshotusing theconcurrent_resumeworkload with 50 concurrent workers and 10 measured rounds:These are end-to-end results for the complete patch and do not attribute the improvement to individual changes.
Related issue
N/A - no linked issue yet.
Scope and non-goals
Included:
Non-goals:
Design and behavior changes
pre_execcallback, the command remains eligible forposix_spawn.Compatibility and operations
Validation
Risks and reviewer notes
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.