Skip to content

Speed up post-restore guest network reconfigure#248

Closed
sjmiller609 wants to merge 2 commits into
mainfrom
codex/instrument-guest-exec
Closed

Speed up post-restore guest network reconfigure#248
sjmiller609 wants to merge 2 commits into
mainfrom
codex/instrument-guest-exec

Conversation

@sjmiller609
Copy link
Copy Markdown
Collaborator

Summary

  • add a guest-agent ReconfigureNetwork RPC that applies restored fork MAC/IP/route updates via netlink instead of spawning shell + ip commands
  • use the RPC for post-resume reconfigure_guest_network, with fallback to the existing shell exec path for older guest agents/snapshots
  • add a gated Firecracker perf harness for repeated snapshot-fork restore timing

Deft validation

On deft-kernel-dev from a short remote workspace (~/hmge):

  • make build-embedded
  • go test ./lib/guest ./lib/system/guest_agent
  • go test ./lib/instances -run "TestGuestNetworkReconfigureConfig|TestGuestNetworkReconfigureCommand|TestNetworkConfigFromAllocation|TestRequiresRestoreConfigDiskRefresh" -count=1
  • sudo env ... HYPEMAN_RUN_RECONFIGURE_GUEST_NETWORK_PERF=1 HYPEMAN_RECONFIGURE_GUEST_NETWORK_PERF_ITERS=3 /tmp/reconfigure-perf.test -test.v -test.run TestReconfigureGuestNetworkPerf -test.count=1 -test.timeout=12m
  • sudo env ... go test ./lib/instances -run TestFirecrackerForkFromRunningNetwork -count=1 -timeout=12m -v

Perf notes

Baseline reproduced reconfigure_guest_network around ~797-943ms, dominated by first post-resume guest exec stream contact and shell/process execution. The netlink RPC reduced the step to ~197-214ms in the final 3-iteration run, with the successful unary apply taking ~35-53ms. Remaining cost is still first-contact grpc_unavailable after resume, so sub-100ms likely needs a separate guest-agent/vsock readiness change or guest-side proactive reconfigure.

@sjmiller609 sjmiller609 force-pushed the codex/instrument-guest-exec branch from 9c5bbb0 to 12c4783 Compare May 30, 2026 19:09
@sjmiller609 sjmiller609 changed the base branch from hypeship/instrument-guest-exec to main May 30, 2026 19:09
@sjmiller609
Copy link
Copy Markdown
Collaborator Author

Closing in favor of #253, which combines the main ReconfigureNetwork + mailbox/VMGenID path with the exploratory pieces trimmed out. Keeping the branch for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant