This guide is for operators evaluating runtime changes and resource pressure. Customer binding APIs and limits are documented in Databases and Images.
Worker execution budgets
The shared pool uses the checksum-pinned, repository-patched workerd build
declared in infra/workerd/release.json. Every
invocation receives a 100 ms active-JavaScript CPU budget and 50 subrequests by
default. Wrangler deployments may declare limits.cpu_ms and
limits.subrequests; the platform accepts values through 5,000 ms and 1,000
subrequests. A separate one-second CPU guard applies while evaluating module
startup and dynamic imports.
Exceeding a CPU budget terminates the offending invocation rather than its pool process. The runtime also applies a 128 MiB V8-attributed memory budget covering the JavaScript heap, ArrayBuffer backing stores, and WebAssembly memory. An isolate that exceeds it is terminated and removed from the loader cache; the next invocation loads a fresh isolate while neighboring Workers remain resident. Both arm64 and x86-64 builds pass the same direct adversarial contract, and the x86-64 build also passes the public Wrangler and native queue contract on the managed profile.
This 128 MiB limit remains fixed for tenant-deployed Workers. A trusted static
service in an operator-owned workerd configuration may set an explicit
executionLimits.memoryMb between 128 MiB and 4 GiB. That exception exists for
bounded platform jobs such as the build-feasibility runner, where a compiler and
its Wasm toolchain need substantially more heap than an application invocation.
It does not add a Wrangler memory setting, reserve RAM for a tenant Worker, or
change the ordinary shared-pool limit.
These are runtime resource controls, not billing meters. They apply when JavaScript executes, including HTTP, queue, scheduled, and service-binding invocations. The pool’s systemd CPU and memory ceilings remain process-level last-resort blast-radius controls.
Shared process containment
The stateless pool members and the child workerd processes owned by native
Durable Object shard managers enter the same host-level execution jail before
loading application code. The launcher provides a minimal read-only filesystem,
an empty private process view, private PID, IPC, and UTS namespaces, no inherited
manager environment or file descriptors, no Linux capabilities, and a seccomp
allowlist. The policy denies process creation, additional namespaces, mounts,
BPF, ptrace, and cross-process memory syscalls while retaining threads and the
SQLite file operations needed by a stateful shard. A stateful child receives
write access only to its designated shard object directory; the manager journal
and encryption key remain outside the child filesystem.
This is a process-containment boundary around a shared runtime, not VM-grade
isolation between Workers in that process. Worker bindings and outbound fetch()
still use explicitly configured workerd services, and a vulnerability that takes
over one shared workerd process can affect other isolates resident in that same
member. The runtime credential accepted by the control plane is domain-separated
from the platform administration credential and is rejected by organization,
Access, certificate, domain, and administrative origin endpoints.
Artifact loading, route resolution, and native AI inference also require a signed route grant scoped to an organization and Worker. Public ingress injects a grant for the exact active version after removing any client-supplied value. Queue and schedule delivery use short-lived Worker grants, while declared service bindings carry a grant for their target Worker and resolve its active version immediately before invocation. The dispatcher removes the grant from requests before tenant application code runs. Existing execution and delivery authentication remains in force; a route grant is an additional requirement rather than a replacement.
During deployment, artifact loading accepts the applied version and the desired version being published to ingress, each requiring its own exact signed grant. This keeps newly routed requests loadable before publication is recorded as complete. Historical versions outside that cutover are not authorized.
This is an incremental authorization migration, not the completed mediation boundary. The signing key and broad data-plane binding credentials still exist inside the shared runtime configuration, so a process takeover can mint grants or use those credentials directly. Do not treat the grants as protection from a compromised runtime until issuance is external and those broad credentials have been removed.
Converge and verify the currently implemented host boundary through the maintained Ansible path:
make runtime-containment PROFILE=singleThe target updates all stateless pool members and native shards, verifies every loaded runtime checksum and readiness endpoint, then compiles and executes a native arbitrary-code probe under the production launcher. A configured systemd directive alone is not considered evidence that containment works.
Native Durable Object shard Workers also receive the declared CPU and subrequest policy. Native incoming events replenish an object’s budget. CPU exhaustion aborts that object’s context; the next invocation reconstructs the object from committed storage without restarting the shard or its sibling objects. Actor SQLite installs a progress callback against that same per-event limit state, so a CPU-heavy native SQL statement is interrupted rather than holding the shared shard indefinitely. This is distinct from dynamic-loader isolate eviction.
The static shards receive the isolate memory boundary, but their configured lifecycle cannot yet retire one tenant Worker isolate independently after memory exhaustion. Do not claim the same memory recovery guarantee for that path. This does not establish a fixed CPU share for a tenant. A permitted long JavaScript turn or native SQL statement can still increase another application’s response latency until its event budget expires.
Tenant admission and noisy neighbors
As a separate defense-in-depth control, Worker ingress has a shared HAProxy
stick table keyed by the organization
identity established by the trusted route. By default, an organization may have
64 active Worker requests across its Workers before new requests receive a
429 response with a short retry hint. The limit is an admission safeguard for
long-lived or bursty traffic; it is not a CPU usage meter, a billing measure, or
a guarantee that every organization receives a fixed share of CPU. It cannot
observe background invocations, active CPU time, or isolate memory; workerd
enforces those boundaries. Its HAProxy stick counter uses a dedicated slot so
it does not conflict with WAF source tracking.
The ceiling is configured with worker_tenant_concurrency_limit in Ansible and
is applied consistently to native and custom Worker hostnames. Queue and
service-binding work is governed by its own delivery/concurrency controls and
the runtime CPU budget; it is not counted as an HTTP request in this table.
Observe pool saturation and rejected-request telemetry before increasing the
ceiling, because a larger value trades tenant burst capacity for shared-pool
headroom.
The exact upstream commit, resource-containment patch, release identifier, and
verified arm64 and x86-64 checksums live in infra/workerd/release.json and
infra/workerd/patches/. Follow the build and adversarial test workflow in
tests/runtime-upgrade/README.md before promoting another runtime.
The Build workerd release GitHub workflow builds and runs the direct runtime contracts on native Linux ARM64 and x86-64 runners. Its live logs, checksums, binaries, and contract reports are retained as workflow artifacts. Pull requests that change the release, patch stack, or contracts run the same matrix before merge. The Ansible build remains a deterministic operator fallback:
ansible-playbook -i infra/ansible/inventory/hosts-single.yml \
infra/ansible/build-workerd-release.yml --limit single-01Both paths check out the exact upstream commit, apply the ordered patch stack, and build with pinned Bazelisk and LLVM toolchains. The Ansible fallback retains a shared Bazel disk cache between release workspaces. Direct builds refuse non-Linux hosts. Promotion and Ansible independently verify that each pinned artifact is a Linux ELF executable for its declared architecture; a matching checksum alone is insufficient.
The verified binary is kept in ignored operator state under .local/workerd/.
Ansible refuses to enable execution-limit claims when that binary is absent or
does not match the checked-in SHA-256. To upgrade, change the pinned version and
commit, rebase the patches, let the workflow qualify both architectures, promote
its two checksums and artifacts, then run make runtime-release-qualify. That
command uses ordinary convergence and status paths before the focused public
runtime, queue, and streaming checks.
Compute members, native Durable Object shards, object storage, queues, key-value, programmable cache, and repositories use that same promoted runtime release. Ansible reads the release and binary checksums from the manifest. Runtime-only convergence updates each consumer’s unit definition before restarting it, including the child processes of native shard managers:
python3 tools/platform.py --profile single runtime
# For the managed host, select --profile latitude instead.make site verifies loaded executable checksums and readiness, recovering any
consumer left on a stale executable by an interrupted rollout. make status
performs the same checks without restarting anything. Installing the new binary
on disk alone does not count as a completed runtime upgrade.
Pool readiness loads and invokes a small dynamic Worker, so HAProxy does not keep a member in rotation merely because its dispatcher shell responds. If a cached tenant Worker reports that its execution context was canceled, the dispatcher advances that Worker’s loader generation. Safe HTTP reads retry once against the fresh generation; other activations fail normally so their existing delivery semantics decide whether to retry. A failed artifact/code load also retires its cache entry so the next request can load it again; this does not replay a mutating invocation. Recycle and verify one member with:
make runtime-member-restart PROFILE=single MEMBER=1
# Use PROFILE=latitude for the managed host.Stateful runtime upgrades restart shared service processes without deleting their persistent data. They can briefly interrupt requests or in-flight work; this is not a zero-downtime or replicated stateful-service upgrade guarantee.
Images capacity
Ansible configures these limits through the images_* inventory variables and
checks that the executor budget leaves memory for the API. Staging lives on the
data host’s disk at /var/lib/ermahgerd-images/spool, not a memory-backed /tmp.
Completed, failed, and disconnected requests clean up their files; restart
removes this service’s abandoned staging directories. At defaults, staging can
hold up to 12 inputs and outputs (roughly 2.25 GiB), so reserve disk headroom too.
Run make test SUITE=capacity on the running local profile to exercise three
parallel 40-megapixel transforms, smaller transforms in another synthetic tenant
scope, and 10 RPS against the photo gallery. The check reports latency, sampled
service memory, OOM kills, and restart changes, then removes its synthetic quota
records. It does not upload or read personal photos.
Database execution
Native SQLite runtime contract
New D1-style databases use native SQLite-backed Durable Objects on the fixed data shards. The pinned enforcing runtime drives SQLite’s progress handler from the actor’s per-event CPU policy: it interrupts a CPU-heavy statement, retires only the offending object, and leaves a second database and the shard process available. Catalogs created before this cutover keep their file-backed Python SQLite engine; no automatic data migration occurs.
To reassess a runtime version on an already provisioned local single-node VM:
python3 services/resources/database/tools/check_native_engine.py \
--guest ermahgerd-single-01 --report .cache/native-database-single.jsonThis opt-in check starts a separate disposable runtime under a 512 MiB, one-CPU cgroup with a 45-second lifetime limit. It checks SQL, transaction and quota-denial rollback, object separation, FTS5, restart persistence, and a CPU-limited recursive query alongside a second database’s small query. It also checks read-only policy, database and result limits, explicit CPU-limit evidence, same-process object recovery with committed state, and continued shard availability. It compares that behavior with the legacy engine using disposable SQLite files. No live database or platform service is changed.
Results are written to .cache/native-database-single.json. A nonzero exit is a
release-blocking regression for the platform runtime, but this expensive native
probe remains outside make check. Native SQL rejects PRAGMA query_only and
PRAGMA max_page_count, so the maintained adapter enforces read-only requests
with workerd’s SQLite changes and schema evidence and enforces size inside the
native storage transaction. SQL-string filtering or checking database size only
after committing is not a substitute.
The same maintained adapter is exercised through the public D1 API for create, query, session bookmarks, restart persistence, FTS5 cleanup, quota accounting, and deletion. Storage growth is reserved with an idempotent operation identifier inside the actor transaction, so a denied reservation or workerd transaction retry cannot commit unaccounted or double-counted pages. Result production is bounded in the actor before the database API receives the response.
Capability checks
Analytical Worker execution
The DuckDB application example supports
bounded, parameterized queries over a private Parquet object. Its optional
npm run probe command evaluates CPU-heavy SQL in disposable workerd processes
with an external watchdog. npm run probe -- --ducklake checks DuckLake’s
catalog and snapshot behavior in the same isolated environment.
The pinned runtime does not pass the shared SQL interruption gate: CPU-heavy Wasm queries can stall other Workers in the same process. DuckDB memory settings also do not bound total runtime memory. These examples do not establish a safe managed analytical database service or a persistent DuckLake catalog.
Run the integration checks on a disposable installation with the required fixtures. These commands create test resources and some restart services; they are not read-only probes of the managed service.
| Integration selection | What it exercises |
|---|---|
make test SUITE=services |
R2, queues, databases, assets, schedules, secrets, and outbound networking |
make test SUITE=platform |
Tenant isolation, telemetry, ingress protection, and shared-runtime boundaries |
make test SUITE=external |
AI and vector search with a configured provider |
make test SUITE=capacity |
Logical Worker density, Images admission, and neighboring traffic |
make test SUITE=continuity |
Deployment continuity under traffic |
make test SUITE=chaos |
Bounded host and runtime faults on the disposable compact Lima VM |
For retained evidence and service measurements, see Platform observability.