-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Summary
Replace SSH-based host-guest communication with virtio-vsock for lower latency and faster VM readiness detection.
Problem
Current SSH-based communication has several overheads:
- 2-second polling interval for readiness detection
- 10-second connect timeout per attempt
- TCP/IP stack overhead inside VM
- SSH protocol handshake overhead
This adds ~3-5 seconds to each VM startup.
Proposed Solution
Use virtio-vsock for direct host-guest communication channel.
Benefits
- No TCP/IP stack required
- No SSH handshake
- Instant readiness notification (no polling)
- Lower latency for all host-guest operations
Technical Approach
- Configure Firecracker with vsock device
- Create vsock listener on host
- Create vsock client agent in guest rootfs
- Replace SSH client with vsock client in executor
- Implement readiness signal via vsock
Key Files
turbo/apps/runner/src/lib/firecracker/vm.ts- Add vsock configturbo/apps/runner/src/lib/firecracker/client.ts- Add vsock to API callsturbo/apps/runner/src/lib/firecracker/guest.ts- Replace SSH with vsockturbo/scripts/deploy-runner/Dockerfile- Add vsock agent
Expected Impact
- Time saved: ~3-5 seconds per VM startup
- Latency: Faster command execution within VM
Considerations
- Requires kernel support in guest (virtio-vsock module)
- Need to develop vsock-based agent for guest
- Significant architectural change
- Can fallback to SSH if vsock unavailable
References
Metadata
Metadata
Assignees
Labels
No labels