Warm pool: never-used containers against a cold start
Whether a pool of locked-down containers that no code has touched, each claimed once and removed after, takes the
container start off the path of a session's first call, and of a single call that asks for one
(SANDBOX_SESSION_POOL; the terms session, cell and relay are defined in
the sessions guide (EXTERNAL · source
repo ↗)). The page has five parts: one call through the daemon (prefer_warm), the newest; the pool as built, the language hints that steer it,
the same pool on OpenShell, and the probe that came first. The probe was measured 2026-10-02 07:51 PDT on a laptop, docker 29.1.3,
image node:22-alpine, the docker provider's lockdown flags, 20 samples per bar, a
node -e snippet as the call. A laptop number, not a product number: what carries over is the ratio and the
breakdown, not the milliseconds.
The one-call path through the daemon (2026-10-29)
A Run, the daemon's call that runs code once in a sandbox of its own, may now carry a
cell (INTERNAL · glossary →), code for
a Python or JavaScript interpreter whose final value is printed, and ask for
prefer_warm: the daemon then runs it in a pool member that is already waiting, a sandbox no code has
touched with both interpreters running, and deletes the member after the one call. With no member free it runs the
cell in a sandbox made for it, as it does without the flag (a miss: the call still runs, only slower).
The answer's warm says which path ran. This section times that call end to end, as a caller sees it:
onecall/main.go builds plimsolld from the checkout, starts it with the docker provider (or, for the OpenShell set, the openshell provider and a local OpenShell gateway, v0.1.2, with its docker driver), image
plimsoll/sandbox-python:latest and a pool of 1 (SANDBOX_SESSION_POOL), and calls it
over loopback (the machine's own network interface) with the Go client, which checks every answer's
run record (INTERNAL · glossary →).
The cell is 6 * 7; 17 samples per bar, each call preceded by an untimed
5.2 s pause so the pool has made its next member; the calls of a repetition run in the same
order, so a change in the machine's load reaches every bar alike.
Six calls per language. One call, warm: a Run with prefer_warm, served by the waiting member.
Session: open + cell: the same work as three calls, what the clients did before the daemon took the path over: a
session opened warm-only (it is handed the waiting member or refused), one cell, then the close, which is not in the bar
(the table has it). Fresh: the Run without prefer_warm, in a sandbox made for it. Miss: a Run
with prefer_warm sent as soon as another such Run has taken the only member, while the pool is still making
the next one, so it runs fresh. Fresh and miss are each measured twice, because a fresh run on docker first re-runs the
provider's Preflight (INTERNAL ·
glossary →), its checks of the docker daemon, the runtime and the images, whenever the last one is 5 s old or more,
and a warm call never does: Preflight due is the call as it comes after the pause, Preflight cached the
same call sent right after a GET /readyz (untimed), which re-runs it. A caller whose calls are seconds apart
on a quiet daemon sees the first; a busy daemon, where some fresh run or readiness check ran in the last 5 s, the
second.
What the bars say, median for median:
- runc (container). A warm call answered in 35 ms (Python) and 42 ms (JavaScript); a fresh one took 690 ms (Python) and 663 ms (JavaScript) with Preflight due and 340 ms (Python) and 320 ms (JavaScript) with it cached. Most of that difference is Preflight itself:
GET /readyztook 345 ms (median) when it ran it. A session claimed from the pool reached its answer in 36 ms (Python) and 41 ms (JavaScript), its warm-only open about 1 ms of it, but its close took a further 118 ms (Python) and 175 ms (JavaScript, anywhere from 114 to 205 ms) before the caller was done; the one call deletes its member after answering, off the caller's path. A miss runs fresh: it took 690 ms (Python) and 659 ms (JavaScript) with Preflight due and 387 ms (Python) and 358 ms (JavaScript) with it cached, -4 to 0 ms and +38 to +48 ms against the fresh call in the same Preflight state, while the pool was making its next member beside it. - gVisor (kernel tier). A warm call answered in 51 ms (Python) and 78 ms (JavaScript); a fresh one took 993 ms (Python) and 906 ms (JavaScript) with Preflight due and 648 ms (Python) and 570 ms (JavaScript) with it cached. Most of that difference is Preflight itself:
GET /readyztook 349 ms (median) when it ran it. A session claimed from the pool reached its answer in 53 ms (Python) and 76 ms (JavaScript), its warm-only open about 1 ms of it, but its close took a further 205 ms (Python) and 167 ms (JavaScript, anywhere from 128 to 236 ms) before the caller was done; the one call deletes its member after answering, off the caller's path. A miss runs fresh: it took 1026 ms (Python) and 959 ms (JavaScript) with Preflight due and 666 ms (Python) and 605 ms (JavaScript) with it cached, +33 to +53 ms and +17 to +34 ms against the fresh call in the same Preflight state, while the pool was making its next member beside it. - OpenShell (container). A warm call answered in 11 ms (Python) and 16 ms (JavaScript); a fresh one took 703 ms (Python) and 701 ms (JavaScript) with Preflight due and 700 ms (Python) and 727 ms (JavaScript) with it cached. This provider's Preflight costs nothing a caller would notice (
GET /readyztook 1 ms), so the due and cached bars are the same call measured twice. A session claimed from the pool reached its answer in 11 ms (Python) and 17 ms (JavaScript), its warm-only open about 1 ms of it, but its close took a further 380 ms (Python) and 378 ms (JavaScript, anywhere from 336 to 462 ms) before the caller was done; the one call deletes its member after answering, off the caller's path. A miss runs fresh: it took 905 ms (Python) and 836 ms (JavaScript) with Preflight due and 895 ms (Python) and 884 ms (JavaScript) with it cached, +136 to +203 ms and +157 to +195 ms against the fresh call in the same Preflight state, while the pool was making its next member beside it.
A warm call here takes longer than a claimed session's first cell in the pool section below (18 and 22 ms under runc for Python and JavaScript, measured 2026-10-02 against the provider directly, with older code). The extra time is somewhere in the request through the daemon, its checks, the run record each side computes and the code changed since; this page does not break it down.
All one-call numbers (ms)
| Runtime | Language | Call | Median | 10th to 90th percentile | Min to max | n |
|---|---|---|---|---|---|---|
| runc (container) | Python | One call, warm | 35 | 31 to 38 | 31 to 41 | 17 |
| runc (container) | Python | Session: open + cell | 36 | 31 to 37 | 31 to 40 | 17 |
| runc (container) | Python | Fresh, Preflight cached | 340 | 321 to 368 | 317 to 404 | 17 |
| runc (container) | Python | Fresh, Preflight due | 690 | 656 to 721 | 650 to 722 | 17 |
| runc (container) | Python | Miss, Preflight cached | 387 | 332 to 423 | 328 to 425 | 17 |
| runc (container) | Python | Miss, Preflight due | 690 | 656 to 745 | 656 to 761 | 17 |
| runc (container) | Python | GET /readyz with Preflight due | 345 | 335 to 378 | 330 to 520 | 17 |
| runc (container) | Python | Session: the open | 1 | 1 to 2 | 1 to 2 | 17 |
| runc (container) | Python | Session: the cell | 34 | 30 to 37 | 29 to 39 | 17 |
| runc (container) | Python | Session: the close | 118 | 116 to 131 | 115 to 180 | 17 |
| runc (container) | JavaScript | One call, warm | 42 | 38 to 44 | 38 to 45 | 17 |
| runc (container) | JavaScript | Session: open + cell | 41 | 37 to 45 | 36 to 46 | 17 |
| runc (container) | JavaScript | Fresh, Preflight cached | 320 | 301 to 333 | 294 to 336 | 17 |
| runc (container) | JavaScript | Fresh, Preflight due | 663 | 633 to 726 | 624 to 808 | 17 |
| runc (container) | JavaScript | Miss, Preflight cached | 358 | 312 to 409 | 311 to 425 | 17 |
| runc (container) | JavaScript | Miss, Preflight due | 659 | 643 to 715 | 612 to 723 | 17 |
| runc (container) | JavaScript | GET /readyz with Preflight due | 347 | 331 to 381 | 328 to 387 | 17 |
| runc (container) | JavaScript | Session: the open | 1 | 1 to 2 | 1 to 2 | 17 |
| runc (container) | JavaScript | Session: the cell | 39 | 36 to 44 | 34 to 46 | 17 |
| runc (container) | JavaScript | Session: the close | 175 | 118 to 202 | 114 to 205 | 17 |
| gVisor (kernel tier) | Python | One call, warm | 51 | 43 to 57 | 43 to 58 | 17 |
| gVisor (kernel tier) | Python | Session: open + cell | 53 | 49 to 57 | 49 to 69 | 17 |
| gVisor (kernel tier) | Python | Fresh, Preflight cached | 648 | 623 to 712 | 610 to 827 | 17 |
| gVisor (kernel tier) | Python | Fresh, Preflight due | 993 | 944 to 1047 | 937 to 1145 | 17 |
| gVisor (kernel tier) | Python | Miss, Preflight cached | 666 | 626 to 781 | 618 to 842 | 17 |
| gVisor (kernel tier) | Python | Miss, Preflight due | 1026 | 1011 to 1125 | 1011 to 1147 | 17 |
| gVisor (kernel tier) | Python | GET /readyz with Preflight due | 349 | 328 to 371 | 315 to 486 | 17 |
| gVisor (kernel tier) | Python | Session: the open | 1 | 1 to 2 | 1 to 2 | 17 |
| gVisor (kernel tier) | Python | Session: the cell | 51 | 47 to 55 | 47 to 68 | 17 |
| gVisor (kernel tier) | Python | Session: the close | 205 | 149 to 234 | 135 to 237 | 17 |
| gVisor (kernel tier) | JavaScript | One call, warm | 78 | 67 to 82 | 65 to 83 | 17 |
| gVisor (kernel tier) | JavaScript | Session: open + cell | 76 | 66 to 91 | 62 to 95 | 17 |
| gVisor (kernel tier) | JavaScript | Fresh, Preflight cached | 570 | 550 to 606 | 539 to 682 | 17 |
| gVisor (kernel tier) | JavaScript | Fresh, Preflight due | 906 | 871 to 1045 | 858 to 1086 | 17 |
| gVisor (kernel tier) | JavaScript | Miss, Preflight cached | 605 | 570 to 679 | 559 to 729 | 17 |
| gVisor (kernel tier) | JavaScript | Miss, Preflight due | 959 | 927 to 1013 | 896 to 1052 | 17 |
| gVisor (kernel tier) | JavaScript | GET /readyz with Preflight due | 345 | 324 to 387 | 324 to 620 | 17 |
| gVisor (kernel tier) | JavaScript | Session: the open | 1 | 1 to 2 | 1 to 2 | 17 |
| gVisor (kernel tier) | JavaScript | Session: the cell | 74 | 65 to 91 | 61 to 94 | 17 |
| gVisor (kernel tier) | JavaScript | Session: the close | 167 | 129 to 210 | 128 to 236 | 17 |
| OpenShell (container) | Python | One call, warm | 11 | 10 to 12 | 10 to 13 | 17 |
| OpenShell (container) | Python | Session: open + cell | 11 | 10 to 15 | 10 to 16 | 17 |
| OpenShell (container) | Python | Fresh, Preflight cached | 700 | 691 to 757 | 654 to 759 | 17 |
| OpenShell (container) | Python | Fresh, Preflight due | 703 | 691 to 794 | 650 to 828 | 17 |
| OpenShell (container) | Python | Miss, Preflight cached | 895 | 807 to 970 | 804 to 984 | 17 |
| OpenShell (container) | Python | Miss, Preflight due | 905 | 848 to 978 | 846 to 1009 | 17 |
| OpenShell (container) | Python | GET /readyz with Preflight due | 1 | 1 to 1 | 1 to 1 | 17 |
| OpenShell (container) | Python | Session: the open | 1 | 1 to 3 | 1 to 5 | 17 |
| OpenShell (container) | Python | Session: the cell | 10 | 9 to 11 | 9 to 13 | 17 |
| OpenShell (container) | Python | Session: the close | 380 | 338 to 479 | 336 to 492 | 17 |
| OpenShell (container) | JavaScript | One call, warm | 16 | 15 to 19 | 15 to 19 | 17 |
| OpenShell (container) | JavaScript | Session: open + cell | 17 | 16 to 18 | 16 to 25 | 17 |
| OpenShell (container) | JavaScript | Fresh, Preflight cached | 727 | 673 to 791 | 668 to 822 | 17 |
| OpenShell (container) | JavaScript | Fresh, Preflight due | 701 | 672 to 738 | 671 to 744 | 17 |
| OpenShell (container) | JavaScript | Miss, Preflight cached | 884 | 784 to 939 | 783 to 948 | 17 |
| OpenShell (container) | JavaScript | Miss, Preflight due | 836 | 829 to 888 | 828 to 939 | 17 |
| OpenShell (container) | JavaScript | GET /readyz with Preflight due | 1 | 1 to 1 | 1 to 1 | 17 |
| OpenShell (container) | JavaScript | Session: the open | 1 | 1 to 2 | 1 to 2 | 17 |
| OpenShell (container) | JavaScript | Session: the cell | 16 | 14 to 17 | 14 to 24 | 17 |
| OpenShell (container) | JavaScript | Session: the close | 378 | 349 to 431 | 336 to 462 | 17 |
The machine while each set ran. The load average is the number of processes running or waiting for a CPU, averaged over the last minute; this laptop has 24 CPUs, and other programs ran beside these sets.
- runc (container): measured 2026-10-29 19:45 UTC; 1-minute load average 1.0 at the start and 0.3 at the end, at most 1.8 as a repetition began.
- gVisor (kernel tier): measured 2026-10-29 20:05 UTC; 1-minute load average 2.2 at the start and 1.0 at the end, at most 2.2 as a repetition began.
- OpenShell (container): measured 2026-10-29 19:23 UTC; 1-minute load average 1.3 at the start and 1.1 at the end, at most 2.9 as a repetition began.
The runc set measured a second time, 2026-10-29 20:26 UTC, with a daemon of its own and the same settings; 1-minute load average 1.6 at the start and 0.4 at the end, at most 1.6 as a repetition began. Every median landed within 7% of the first set's, medians in ms:
| Language | Call | First set | Second set | Change |
|---|---|---|---|---|
| Python | One call, warm | 35 | 33 | -7% |
| Python | Session: open + cell | 36 | 35 | -1% |
| Python | Fresh, Preflight cached | 340 | 333 | -2% |
| Python | Fresh, Preflight due | 690 | 672 | -3% |
| Python | Miss, Preflight cached | 387 | 380 | -2% |
| Python | Miss, Preflight due | 690 | 678 | -2% |
| JavaScript | One call, warm | 42 | 39 | -7% |
| JavaScript | Session: open + cell | 41 | 40 | -1% |
| JavaScript | Fresh, Preflight cached | 320 | 319 | 0% |
| JavaScript | Fresh, Preflight due | 663 | 662 | 0% |
| JavaScript | Miss, Preflight cached | 358 | 362 | +1% |
| JavaScript | Miss, Preflight due | 659 | 664 | +1% |
Checked on every sample, not assumed:
- runc (container): 68 of 68 warm and session samples answered by a waiting member, 136 of 136 fresh and miss samples by a sandbox made for it; the daemon's audit log recorded 108 cell Runs warm and 144 fresh, the warm-up and the untimed calls that took the member included; docker's event log showed the run containers each call should make (one for a fresh or miss call, none for a warm call or a session) in 204 of 204 samples; no plimsoll containers remained after the daemon stopped.
- gVisor (kernel tier): 68 of 68 warm and session samples answered by a waiting member, 136 of 136 fresh and miss samples by a sandbox made for it; the daemon's audit log recorded 108 cell Runs warm and 144 fresh, the warm-up and the untimed calls that took the member included; docker's event log showed the run containers each call should make (one for a fresh or miss call, none for a warm call or a session) in 204 of 204 samples; no plimsoll containers remained after the daemon stopped.
- OpenShell (container): 68 of 68 warm and session samples answered by a waiting member, 136 of 136 fresh and miss samples by a sandbox made for it; the daemon's audit log recorded 108 cell Runs warm and 144 fresh, the warm-up and the untimed calls that took the member included.
- runc, second set: 68 of 68 warm and session samples answered by a waiting member, 136 of 136 fresh and miss samples by a sandbox made for it; the daemon's audit log recorded 108 cell Runs warm and 144 fresh, the warm-up and the untimed calls that took the member included; docker's event log showed the run containers each call should make (one for a fresh or miss call, none for a warm call or a session) in 204 of 204 samples; no plimsoll containers remained after the daemon stopped.
What these numbers do not show:
- Another machine or a network. One laptop (linux/amd64, 24 CPUs, 18 GiB memory, go1.26.10), docker 29.1.3 on the same machine as the daemon and the client, so no network lies between them.
- A workload. The cell does almost nothing, so the bars are the path's own cost, not a program's run time.
- Bursts. The pool held 1 member and the calls came 5.2 s apart; more calls at once than the pool holds, or calls faster than it refills, turn warm calls into misses. The miss was measured only as the second of two calls in a row.
- The machine's work. A warm call still costs a sandbox's start and removal; the pool makes them off the caller's path. What a waiting member holds in memory is measured in the sections below, not here.
- The wall clock. This laptop's clock stepped back about a second several times during the sets; the samples are timed on the monotonic clock, which such a step does not move.
Built: the pool with interpreters attached (2026-10-02)
Each never-used member gets an interpreter started and its relay attached
for every language the image runs, and OpenSession hands one over. Measured
2026-10-02 with pooled/main.go against the provider directly (not through
plimsolld), image plimsoll/sandbox-python:latest, 10 samples per bar, 3 s
between samples so the pool refills, a cell of 6 * 7. Without a pool the time is a container start, the
read-back and process list, then the first cell starting the interpreter and its relay.
What made the first measurement slow: OpenSession re-ran the docker Preflight, which re-runs once its
result is 5 seconds old, before claiming. A claim now skips it: the member was verified when it was made and is read
back before every call, and it must match the execution state the last Preflight verified. With that, claiming takes
under a millisecond and the time is the first cell's. The cost is memory: the interpreters a waiting member holds count
inside its session's memory limit, including the language a session never uses.
Language hints (2026-10-02)
A session may name the languages its cells
will use. It is handed the waiting member warming the most of them, and the pool divides its size across language sets
by a weight that follows roughly the last 16 to 32 opens. Measured 2026-10-02 with
hints/main.go against the provider directly, a pool of 4, 3 s between opens.
Every hinted open got a warm member (a cold open is about 740 ms). Its first cell answered in
31 to 53 ms,
above the 18 to 22 ms of the pooled run above; that gap was not investigated. A hint changes latency, never behavior: a cell in a language the member did not warm still runs, starting its
interpreter on first use, and a session without a hint counts as wanting every language. Hints move members between
sets and never add any, so SANDBOX_SESSION_POOL still bounds the memory.
OpenShell (2026-10-28)
The same pool on the openshell provider, which runs each sandbox through an OpenShell gateway: one
mechanism, with OpenShell's own way of making, checking and deleting a member. Measured 2026-10-28
with openshell/main.go against a local gateway (OpenShell v0.1.2, its docker driver, runc), image
plimsoll/sandbox-python:latest, 15 samples per bar, 3 s between samples.
Before the pool was built, the same program timed the first call in a session opened ahead of time, as a waiting
member would be: 110 ms for a JavaScript cell with its
interpreter not yet started and 7 ms with it running,
against 716 ms to open a session and run that cell. That was the reason to
build it.
Without a pool, the open alone takes 607 ms: the gateway creates the sandbox and its supervisor and reports it ready, and plimsoll reads it back and records its processes. A snippet in a claimed sandbox took 40 ms against 652 ms, most of it the read-back and the sweep every session call makes here.
The probe before the build: a plain pool
Time to first output
"Cold run" is today's path: docker run --rm of the snippet. "Pool claim" is docker exec of
the same snippet into a pre-started, never-used member. "Read-back" adds the docker inspect a session
already makes before every call; a pool would make it at claim.
Where a claim's time goes
trueNode starting and printingMost of what remains is the docker exec round trip and Node starting. A warm session cell takes 14 to 15
ms on this laptop because its relay is already attached and its interpreter already running (measured 2026-10-01);
a pool member could be prepared the same way, which is what the pool as built (above) does.
What it costs
- Memory held while idle: about 17 MiB per member under gVisor (its Sentry), under
1 MiB under runc. A pool of 8 under gVisor holds about 137 MiB, which
SANDBOX_TOTAL_MEMORY_MBwould have to count. - Restocking, off the call's path: starting a member takes 133 ms (runc) and 157 ms (gVisor); removing one 98 and 120 ms.
- No clone caveats: every member boots on its own, and none is ever handed to a second call.
All numbers
| Runtime | Measure | Median, pass 2 | Median, pass 3 | p90, pass 2 |
|---|---|---|---|---|
| runc (container) | cold_run | 210 ms | 206 ms | 222 ms |
| runc (container) | claim_exec | 83 ms | 76 ms | 95 ms |
| runc (container) | claim_inspect_exec | 88 ms | 94 ms | 100 ms |
| runc (container) | pool_member_start | 133 ms | 133 ms | 146 ms |
| runc (container) | member_remove | 98 ms | 72 ms | 125 ms |
| runc (container) | idle_member_mib | 0.5 MiB | 0.5 MiB | 0.5 MiB |
| gVisor (kernel tier) | cold_run | 275 ms | 277 ms | 297 ms |
| gVisor (kernel tier) | claim_exec | 81 ms | 82 ms | 84 ms |
| gVisor (kernel tier) | claim_inspect_exec | 91 ms | 100 ms | 98 ms |
| gVisor (kernel tier) | pool_member_start | 157 ms | 147 ms | 169 ms |
| gVisor (kernel tier) | member_remove | 120 ms | 123 ms | 152 ms |
| gVisor (kernel tier) | idle_member_mib | 17.2 MiB | 17.3 MiB | 17.2 MiB |
Pass 1 agreed with these to within 10 ms.
The data and how to rerun it
Raw samples beside this page: pass-2.json and pass-3.json (the
probe), pooled-runc.json and pooled-runsc.json (the pool
as built), hints-runc.json (language hints), openshell.json (the pool
on OpenShell), onecall-runc.json, onecall-runsc.json, onecall-openshell.json, onecall-runc-repeat.json (one call through the daemon). exec-split.json
holds two medians per runtime timed by hand (docker exec of true, and of the snippet); no
program reproduces it. The programs are in
measurements/warm-pool
(EXTERNAL · source repo ↗). From a checkout, with the images make docker-images builds (and
gVisor installed for the runsc runs):
python3 measurements/warm-pool/probe.py 20 docs/measurements/warm-pool/pass-2.json
go run ./measurements/warm-pool/pooled # runc
go run ./measurements/warm-pool/pooled -runtime runsc # gVisor
go run ./measurements/warm-pool/hints
go run ./measurements/warm-pool/openshell # SANDBOX_OPENSHELL_* naming a gateway
go run ./measurements/warm-pool/onecall # runc, through plimsolld
go run ./measurements/warm-pool/onecall -runtime runsc # gVisor
go run ./measurements/warm-pool/onecall -tag repeat # runc again, a second file
go run ./measurements/warm-pool/onecall -provider openshell # SANDBOX_OPENSHELL_* naming a gateway
python3 measurements/warm-pool/report.py
Your numbers will differ from these: they are one laptop's. What should carry over is the ratio between a pool and a cold start, and where the time goes.