Performance Overview
SmolVM is optimized for low-latency agent workflows, delivering sub-second boot times and fast command execution. Understanding these performance characteristics helps you build responsive AI agents.Lifecycle Benchmarks
Latest lifecycle timings (p50) measured on a standard Linux host with AMD Ryzen 7 7800X3D (8C/16T), Ubuntu Linux, KVM/Firecracker backend:| Phase | Time |
|---|---|
| Create + Start | ~572ms |
| SSH ready | ~2.1s |
| Command execution | ~43ms |
| Stop + Delete | ~751ms |
| Full lifecycle (boot → run → teardown) | ~3.5s |
These benchmarks represent median (p50) values. Your actual performance may vary based on host hardware, kernel version, and system load.
Running Benchmarks
You can measure performance on your own infrastructure using the included benchmark script:Benchmark Options
Number of VMs to benchmark for statistical analysis
Count subprocess calls without executing (works on any platform)
Output results as JSON for automated ingestion
Enable detailed logging of each benchmark phase
Understanding Benchmark Metrics
The benchmark script measures these key phases:- Create (network setup): TAP device creation, NAT configuration, and IP allocation
- Start (boot): VM boot and Firecracker/QEMU process initialization
- SSH ready: Time until SSH connection is available
- Run cmd (1st): First command execution (cold SSH connection)
- Run cmd (2nd): Second command execution (warm SSH connection reuse)
- Stop: Graceful VM shutdown
- Delete (network teardown): Cleanup of network resources and VM state
Optimization Tips
Reduce Boot Time
Minimize the time from VM creation to SSH availability:Use isolated disk mode
The default
disk_mode="isolated" provides per-VM disk isolation with minimal overhead:Pre-build custom images
Build images with pre-installed dependencies to avoid package installation during runtime:
Optimize Command Execution
Command execution is already fast (~43ms), but you can optimize further:SSH connections are automatically reused within the same VM instance, reducing latency for subsequent commands.
Memory and Resource Sizing
Configure VM resources based on your workload:High-Density Deployments
When running many VMs concurrently:- Monitor host resources: Each VM consumes memory and CPU. Plan capacity accordingly.
- Stagger VM creation: Avoid creating dozens of VMs simultaneously to prevent resource contention.
- Use cleanup: Regularly clean up stopped VMs to free resources:
Performance Characteristics by Backend
Firecracker (Linux)
- Boot time: Sub-second to SSH ready (~2.1s total)
- Memory overhead: ~5-10MB per VM (beyond guest allocation)
- Best for: Production deployments, high-density scenarios
QEMU (macOS)
- Boot time: Slightly slower than Firecracker
- Memory overhead: Higher than Firecracker
- Best for: Development and testing on macOS
The backend is automatically selected based on your platform. Use
smolvm doctor to verify your configuration.Monitoring Performance
Track VM performance in your application:Performance Troubleshooting
If you’re experiencing slower than expected performance:Check host KVM support (Linux)
Check host KVM support (Linux)
Verify KVM is enabled and accessible:Without KVM, performance will be severely degraded.
Monitor system load
Monitor system load
High CPU or memory usage on the host can impact VM performance:
Review network configuration
Review network configuration
Network setup overhead appears in the “Create” phase. If this is slow:
Verify image integrity
Verify image integrity
Corrupted or slow disk I/O can impact boot time:
Next Steps
Troubleshooting
Debug common issues and errors
Security Considerations
Best practices for secure deployments