Choose a policy
Start with
auto on a dedicated host. Use spread for CPU-heavy throughput work. Use compact when cache locality or packing more sandboxes onto a host matters most.
Keep CPU and memory on one NUMA node
Large hosts can have more than one NUMA node. A placement profile can keep a sandbox’s CPU and memory on the same node. First, define a named profile in the global config:prefer_single uses one node when enough CPU and memory are available. Otherwise, it falls back to normal placement. Use strict_single when the sandbox should fail instead of falling back.
What placement guarantees
- Microsandbox coordinates only sandboxes that share the same
MSB_HOME. - Placement considers the sandbox’s maximum CPU count, not only the CPUs online at boot.
- When exclusive CPU capacity runs out, normal policies may share logical CPUs.
- Placement does not isolate unrelated host processes or reserve dedicated cores.
- On macOS, managed policies fall back to
inheritbecause hard CPU affinity is not available through a public API. - If placement cannot be applied, normal policies fall back to
inherit. Astrict_singleprofile fails instead.
msb inspect worker to see the resolved policy and placement result.