Micro-VM Boot Latency Optimization for Agent Wake Times

Firecracker micro-VM isolation gives each AI agent its own kernel through KVM hardware virtualization, providing a boundary for untrusted or LLM-generated code without containers. Micro-VM boot latency optimization for agent wake times preserves that boundary while reducing the wait. Cold boot is the starting point, and snapshot-restore, lazy memory paging, and speculative prewarming form a ladder for meeting stricter responsiveness requirements.
Why agent wake time is a product problem, not just an infrastructure detail
A multi-turn coding agent can make users wait for its environment at every tool invocation. SpecBox identifies how sandbox startup overhead accumulates across successive invocations, degrading end-to-end responsiveness and limiting interactive agent services. In the sequential execution model, sandbox preparation begins only after LLM inference finishes. The user therefore waits for inference and then for the environment, with both costs on the critical path. A delay that seems acceptable in an isolated operation becomes a recurring interruption across a workflow.
A per-user assistant waking on each message exposes the same problem in a simpler form. If every message triggers a cold boot, hundreds of milliseconds of infrastructure work become visible response latency. For products that cannot absorb that pause, sub-50ms wake time becomes a product requirement. Both how quickly a VM boots and how much environment preparation the user must wait for therefore matter.
What Firecracker's cold-boot baseline actually measures and where the time goes
Firecracker boots to userspace in approximately 125ms with roughly 5MB of memory overhead. That baseline assumes a minimal kernel with the serial console disabled, so enabling console logging raises the result. It describes a specific boot configuration and endpoint. A benchmark that ends at userspace and one that ends at an application handshake measure different amounts of work. Their numbers cannot be treated as interchangeable.
A cold start goes through virtual machine monitor startup, kernel boot, guest initialization, and the application handshake. Even with a fast virtualization primitive, these steps can take a long time before first execution. Host preparation adds work outside the guest, while launching many microVMs in parallel introduces scheduler contention and stretches tail latency. Consequently, the wall-clock result depends on both what the guest initializes and what the host must arrange. The kernel boot figure captures only part of that budget.
SpecBox characterizes broader sandbox initialization overhead as “second-level delay”, including image loading, filesystem preparation, namespace configuration, and runtime handshake. That characterization concerns sandbox readiness rather than Firecracker's minimal boot-to-userspace baseline. Before choosing what to speed up, teams need to know where the measurement starts and stops. Skipping kernel initialization cuts out one part of startup, while removing application initialization cuts out another. Neither alone establishes how quickly a request reaches a ready agent.
How snapshot-restore collapses the boot sequence into milliseconds
Snapshot-restore replaces repeated initialization with the restoration of an already prepared guest. The process boots a microVM to a ready state once, snapshots its memory and block device state to local NVMe, and restores subsequent instances from that snapshot. Firecracker achieved a three-millisecond restore on aarch64 before console logging was enabled. With console logging enabled, that rose to approximately eight and a half milliseconds, still far below its cold-boot baseline.
AWS Lambda uses this pattern in SnapStart by snapshotting the Firecracker microVM's memory and disk state after initialization. Restoring that state on cold starts means the user no longer has to wait for application initialization. Its Firecracker restore step is targeted at 40ms or less, making restore one bounded stage within a larger pipeline. SmolVM does the same through snapshot-and-fork, which restores in milliseconds when work is repeated and skips another boot sequence. The VM becomes a reusable template instead of an artifact that must be rebuilt for every operation.
The benefit also extends to host memory. A restored snapshot costs roughly 5MB of host RSS versus roughly 56MB for a cold-booted guest, improving density as well as wake time. This is a different measurement from Firecracker's minimal virtual machine monitor memory overhead. For persistent VM-per-agent systems, including Maritime's model, that reduction changes the economics of keeping an isolated environment for each agent.
A guest restored from a snapshot taken an hour ago has a frozen clock, which leads to clock drift. The fix is explicit clock synchronization on restore, on resume, and on wake from hibernate. The application or agent-runtime layer must provide that synchronization. A fast restore is not operationally complete until this state is corrected.
What lazy memory paging with userfaultfd adds on top of basic snapshot-restore
Basic snapshot-restore removes initialization, but eagerly loading an entire memory image can impose another floor on wake time. The guest may need only part of that image to begin useful execution. Linux userfaultfd lets a userspace process intercept page faults and serve memory pages as they are needed, so execution can start before the full snapshot is copied.
DigitalOcean's Managed Agents architecture uses userfaultfd lazy paging as one of several techniques contributing to its warm-path target. The mechanism is especially relevant when snapshots contain substantial working state, because a minimal bootstrapped guest offers less memory-loading work to defer. A large image can have a small initial working set. Loading both as though they were the same makes cold pages part of the wake budget.
Aquifer, from The Chinese University of Hong Kong and Virginia Tech in June 2026, found that the vast majority of snapshot pages were either zero or cold. Its hotness-based snapshot format eliminates zero pages, places the hot working set in a CXL pool, and stores cold pages in an RDMA pool. On emulated CXL+RDMA hardware, it achieved a geometric-mean speedup of 2.2× in end-to-end invocation latency over standard Firecracker.
Speculative prewarming: overlapping sandbox boot with LLM inference
Snapshot-restore and lazy paging shorten preparation, but they do not determine when preparation begins. If the runtime waits until inference finishes, even a short restore remains on the critical path. SpecBox, from Beihang University et al. in July 2026, attacks this sequential execution model by starting sandbox preparation during token generation. When a tool call is predicted correctly, all of its preparation can take place during inference. The architectural shift is from making a stage faster to scheduling it before the user would otherwise wait for it.
SpecBox combines intent-driven prewarming with context-aware stochastic prefetching. The first uses keyword matching and streaming semantic embedding to identify the sandbox a likely tool call will need before the LLM finishes its response. The second uses a sandbox dependency graph to predict when the sandbox will need to switch later in multi-turn sessions. Together, they extend the preparation window from the current generation step into the sequence of likely future work. This requires an orchestration layer that treats inference and environment preparation as a pipeline of overlapping tasks.
SpecBox also includes a semantic result cache that prunes redundant sandbox invocations and an out-of-band shared-memory transport plane for zero-copy artifact transfers. These are separate optimizations, so its reported gains should not be attributed to prewarming alone. On high-concurrency multi-turn agent traces, the combined system cuts P99 end-to-end latency by up to 2.9× relative to an on-demand sandbox baseline. It also uses much less memory at its peak than sandboxes that are kept reserved all the time.
A wrong prediction allocates a sandbox that the agent does not need. SpecBox's dependency-graph-based stochastic prefetching is designed to bound this waste, but independent implementations need to instrument misprediction rates. The trade-off is therefore not latency against isolation, but visible waiting against potentially unused preparation. Predictable tool sequences make that exchange more attractive. Less predictable sequences leave more uncertainty in the value of starting early.
Reading the full latency budget: what numbers look like across the optimization ladder
JumpHash/agentplaza's October 2026 measurements place cold boot to first heartbeat at approximately 317ms p50 on x86_64 KVM with real guests. On the same hardware, snapshot restore to a console answer takes approximately 13ms p50, a more-than-20× reduction. These endpoints differ, but the measurements still show how much repeated boot work restoration can remove. They also explain why a minimal boot-to-userspace result is not enough to predict a real guest's readiness. The useful comparison includes both the elapsed time and the event that stops the clock.
The same setup takes approximately 500ms for chat to a sleeping agent, including wake and dispatch. That larger result is not a contradiction of the fast restore measurement. Wake admission, placement, and dispatch take time around the restore, and the user waits for all of them. DigitalOcean's October 2026 Managed Agents warm-path budget similarly targets under 200ms p50 from request to serving traffic, allocating 40ms or less to Firecracker snapshot restore.
Cold boot pays for initialization, snapshot-restore substitutes prepared state, and lazy paging defers memory that execution does not yet need. Speculative prewarming then overlaps the remaining preparation with inference, bringing the user-visible sandbox contribution toward zero for correctly predicted calls.
Choosing the right technique for your agent's responsiveness requirements
Cold boot with a minimal kernel is appropriate when agents run infrequently, sessions last long enough to amortize startup, or simplicity matters more than wake latency. It is the least infrastructure to manage and the easiest approach to reason about. By contrast, snapshot-restore is the baseline for per-user or per-session agents expected to respond near-instantly after an idle period. The choice follows from wake frequency and the product's tolerance for waiting, rather than from the smallest benchmark number available.
For agents that spend most of their time idle, snapshots also allow storage to replace active compute as the idle cost. That is the architectural basis for sub-dollar-per-month per-agent economics at scale, rather than a reason to reserve running capacity indefinitely. Maritime's snapshot-and-restore scheduler uses the snapshot as the persistent home of a sleeping agent and restoration as a sub-second wake. It automatically manages the cold-boot-to-wake ladder through snapshot-restore scheduling, allowing developers to deploy persistent agents without redesigning their product around that latency management. The per-agent VM remains the unit of isolation and persistence.
Lazy paging is the next step when restoring all of memory takes enough time to matter or when a fleet wastes memory bandwidth loading cold pages. It requires platform support but no change to agent code. Speculative prewarming is justified for predictable multi-turn workflows that require sub-100ms tool-invocation latency. It takes more work to build because the orchestration layer needs access to streaming token output and a dependency graph, and teams then need to track misprediction waste.
Isolation remains orthogonal to those scheduling choices. Each technique operates within the Firecracker micro-VM model, preserving an agent's own kernel through KVM hardware-enforced isolation. The techniques are complementary, with snapshot-restore supplying ready state, lazy paging reducing immediate memory work, and prewarming overlapping the remainder with inference.


