-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Overview
This is the tracking issue for the Firecracker VM startup optimization effort. The goal is to reduce VM startup time from 20-25 seconds to 3-5 seconds.
Current State
| Phase | Time | Bottleneck Level |
|---|---|---|
| Rootfs copy (2GB) | ~12s | 🔴 Critical |
| Network setup | ~0.5s | 🟢 Low |
| Firecracker spawn | ~0.2s | 🟢 Low |
| VM boot (kernel + systemd) | ~5-8s | 🟡 Medium |
| SSH readiness | ~3-5s | 🟡 Medium |
| Post-boot setup | ~1-2s | 🟢 Low |
| Total | 20-25s |
Target State
| Phase | Current | Target | Optimization |
|---|---|---|---|
| Rootfs copy | 12s | 0.003s | BTRFS reflink |
| VM boot | 5-8s | 1-2s | Minimal init |
| SSH readiness | 3-5s | <1s | Vsock |
| Total | 20-25s | 3-5s |
Optimization Tasks
Phase 0: Foundation (Dev Mode)
- feat(runner): add benchmark command for VM performance testing #1165 - Dev mode for local testing & benchmarking
Phase 1: High Impact (~12s savings)
- perf(runner): implement BTRFS reflink for instant rootfs copy #1162 - BTRFS reflink for instant rootfs copy
Phase 2: Boot Optimization (~3-5s savings)
- perf(runner): implement vsock for host-guest communication #1163 - Vsock for host-guest communication
- perf(runner): replace systemd with minimal init for faster boot #1164 - Minimal init to replace systemd
POC Validation Results
Tested on target machine (35.87.132.135 - ARM64, 16 CPU, 31GB RAM, gp3):
| Test | Result |
|---|---|
| gp3 write speed | 174 MB/s |
| EXT4 reflink | ❌ Not supported |
| BTRFS reflink (2GB) | ✅ 0.003s |
| RAM disk speed | 1.1 GB/s |
| KVM support | ✅ Available |
Success Metrics
| Metric | Current | Target | Status |
|---|---|---|---|
| VM startup time | 20-25s | <5s | 🔄 In Progress |
| Rootfs copy time | 12s | <0.1s | 🔄 Pending |
| SSH ready time | 3-5s | <1s | 🔄 Pending |
Recommended Order
- feat(runner): add benchmark command for VM performance testing #1165 Dev Mode - Enables testing and benchmarking for other optimizations
- perf(runner): implement BTRFS reflink for instant rootfs copy #1162 BTRFS - Highest impact, well-validated approach
- perf(runner): replace systemd with minimal init for faster boot #1164 Minimal Init - Reduces boot overhead
- perf(runner): implement vsock for host-guest communication #1163 Vsock - Most complex, do last
References
- Research document:
/tmp/deep-dive/runner-perf-optimization/research.md - Innovation document:
/tmp/deep-dive/runner-perf-optimization/innovate.md
Metadata
Metadata
Assignees
Labels
No labels