You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't do a very good job accounting for actors' memory overhead today, which is a bit of a problem with the multi-actor worker model.
Today the micro-VM worker takes a flat 128MiB out of each actor's memory limit for the VMM, which is too much for small guests and too little for large ones, and nothing else accounts for what an actor costs outside its sandbox when placing it.
I propose the following API:
Wrap SandboxRuntime in WorkerRuntime, which also has RuntimeOverhead
RuntimeOverhead contains a fixed memory + proportional memory overhead (proportional to the actor's memory limit)
The overhead hangs off the runtime rather than the worker, because it depends on the runtime: A worker can restore actors under older runtime versions, and we may have workers that run more than one sandbox class. Snapshot and WorkerAssignment keep the plain SandboxRuntime, so the overhead isn't part of compatibility matching.
The behavior change is then:
micro-VM stops subtracting 128MiB from the actor template's memory limit, the guest gets all of it
scheduling starts considering the worker-published overhead model when booking an actor
workers report their memory limit minus a small fixed amount for themselves (the worker process and in-flight snapshot writes) as capacity
Diff:
Details
(your diff, unchanged)
This issue is related to the next one I'll file, around mitigating OOMKill ...
Note: the API changed since this was drafted, so WorkerSandboxRuntime is a real object that will obviate introducing WorkerRuntime but otherwise the proposal stands.
Maybe, but CPU is compressible, memory is causing downtime (#3092, filed in conjunction with this), so CPU can be enhanced post-GA. The sandbox processes are anyhow not using a lot of CPU directly (though they can still have CPU cost in a different way due to syscall/interrupt handling etc).
Activity
thockin commentedon Oct 21, 2026
We spoke IRL and this model feels right to me.
EItanya commentedon Oct 21, 2026
Seconded that this feels right
BenTheElder commentedon Oct 22, 2026
Note: the API changed since this was drafted, so
WorkerSandboxRuntimeis a real object that will obviate introducingWorkerRuntimebut otherwise the proposal stands.BenTheElder commentedon Oct 22, 2026
#3104
mowangdk commentedon Oct 25, 2026
Shouldn't the CPU have a similar mechanism as well?
BenTheElder commentedon Oct 25, 2026
Maybe, but CPU is compressible, memory is causing downtime (#3092, filed in conjunction with this), so CPU can be enhanced post-GA. The sandbox processes are anyhow not using a lot of CPU directly (though they can still have CPU cost in a different way due to syscall/interrupt handling etc).
MicroVM guests get their whole memory limit, and placement books each…