mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[GH-ISSUE #125] Analyze boot/resume latency #41
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#41
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?
Originally created by @yingdi-shan on GitHub (Aug 5, 2026).
Original GitHub issue: https://github.com/kvcache-ai/AgentENV/issues/125
Summary
A regular Ubuntu 24.04 snapshot resume, with the Firecracker pool and shared memory device warm, takes:
Instrumentation accounts for 46.26 ms, or 98.53% of the mean. This covers the common restore path used by snapshot-backed sandbox creation and paused sandbox resume. Fresh VM boot is excluded.
The benchmark measures
FirecrackerSandbox::resume_from_snapshot_config: constructing the runtime from an already-resolved snapshot config, restoring Firecracker, waiting for envd health, initializing envd, and returning a ready sandbox.Reproduction Environment
Hardware and host requirements:
/dev/kvmaccess/dev/ublk-controlaccessSoftware and workload:
6.8.0-111-generic1.15.1-patch-v1vmlinux-6.1.1750.5.15To reproduce the regular result, warm the Firecracker and network pools and keep one sandbox from the same snapshot alive so the shared memory ublk device remains referenced.
Time Breakdown
Before the vCPU resumes, setup consumes 17.54 ms. Guest health and envd initialization consume another 28.72 ms after the vCPU starts.
Analysis
The 2.95 ms rootfs OverlayBD bind consists of approximately:
Memory binding costs only 0.034 ms because another live sandbox retains the shared memory ublk device.
guest_readyis the completeGET /healthwait while the vCPU is running. It includes guest execution, demand paging, scheduling, networking, envd processing, and occasional retry delay. It is not 22 ms of host-side polling.A separate trace measured approximately 2.3k KVM faults and 11.60 ms of cumulative
kvm_tdp_page_faulthandler time.envd_initis a subsequentPOST /initcall and costs another 5.71 ms.Follow-up Opportunities