Video
Firecracker memory hotplug for agent VMs, in 36 seconds
· 36 seconds
A Plori agent VM boots with 1024 MiB. When a command needs more, the VM asks its node for a 1536 MiB Firecracker virtio-mem region, and it gives the memory back after 120 seconds of low use.
A Rust build needs 2 GB, and the VM has 1 GiB
Of the VM's 1024 MiB, 728 MiB is for the agent's commands and 256 MiB is kept for the
guest system. rustc needs about 2 GB, so the kernel kills it at the 728 MiB limit.
The VM asks its node for memory
- Memory use comes within 192 MiB of the limit of the agent's commands.
- A watcher in the guest posts a target size to the node daemon.
- The node daemon checks its memory budget and sets the size on Firecracker's virtio-mem device.
- The memory appears in the guest.
- The watcher raises the limit of the agent's commands from 728 MiB to 2264 MiB.
One build, sampled every 10 seconds
- During the toolchain download and the clone, nothing is plugged.
- 1.5 GiB is plugged within 11 seconds of the build starting.
- The build takes 2 min 26 s. A VM with a fixed 2.5 GiB takes 2 min 22 s.
- The build has 0 out-of-memory kills.
- The memory is unplugged after 120 seconds of low use, and 892 MiB stays in use.
In a single-VM prototype, plugging 1536 MiB took 17 to 49 ms.
These numbers are from one build on staging and from a prototype, both in December 2026. Production had granted no memory request at that time. The post has the two triggers that failed and the limits: Firecracker memory hotplug for agent VMs: trigger on anonymous memory, not a soft limit.