Repository navigation
Description
What happens today
Schedule in cmd/ateapi/internal/scheduling filters workers by sandbox class, runtime, selectors and room, samples two and takes the less loaded. Whether a node already has the actor's image is not an input.
Measured: with 16 actors per image over 40 nodes, atelet's image-cache counters show 1.02 cold pulls per actor, meaning the 16 actors of one image landed on 13 to 16 different nodes and each node unpacked the image. With one actor per image over 783 nodes, 0.98 to 1.07 pulls per actor. atelet's restore records put oci_unpack at 1 ms when the image is on the node and 9 to 50 s when it is not (up to 300 s when many unpacks share one node's CPU and disk), and unpack is about 97% of a cold first command. The golden snapshot does not help here: a cold restore from a golden onto a node without the image (16.6 s median) was no faster than a cold boot of the same image (14.6 s), because unpack dominates both.
Proposal
Among workers with room, prefer one on a node that already holds the actor's image, as a soft preference, with today's two-random-candidates choice as the fallback. atelet reports the images in its cache, or a compact summary of them, in the worker status so the scheduler can use it. For 16 actors of one image this cuts image pulls per step by about an order of magnitude with no change to image delivery, and it is what makes golden snapshots pay off at scale: a golden is fast only where the image is already present.
The same preference applies to the detach path (resume from a full node), which today restores onto any worker with room.
How to see it
- A pool of N nodes; an ActorTemplate per image for images no node has pulled.
- Create 16 actors per template and send one command each.
- Read atelet's image-cache hit and miss counters before and after: misses per actor are near 1, not near 1/16.
Setup
Setup: two GKE worker pools. Pool A: 40 x n2-standard-8 (8 vCPU, 32 GiB, Intel Cascade Lake), 192 GB pd-balanced boot disk, 320 worker pods. Pool B: 783 x e2-standard-8 (8 vCPU, 32 GiB, AMD Rome), 500 GB pd-balanced boot disk, 2,000 worker pods. ateapi at 2 to 12 replicas; Postgres on one n2-standard-16 with pd-ssd. Images: SWE-bench Verified (445, about 1.1 GB compressed median, 13 layers), R2E-Gym-V1 (8,101, 0.57 GB compressed median, 1.9 GB max, 14 layers, almost no layer sharing), a 36,871-image SWE-RL set (0.5 to 1.4 GB compressed median per subset, up to 13 GB squashed single-layer images); unpacked size 2 to 2.5 times compressed; plain containerd pulls from a same-region Artifact Registry. gVisor (runsc), GKE 1.36.4-gke.2046002, Container-Optimized OS, Linux x86_64. Observed on Substrate 0fdb67b; the code cited is unchanged on main at a508f8f.
Activity
BenTheElder commentedon Oct 30, 2026
Please search for existing issues when filing issues. #276
zoez7 commentedon Nov 5, 2026
This should be extended to nodes with cached snapshots as well.