Diffinery

homeflare/celldpublic

celld/docs/README.md
1025 lines · 57.6 KBRaw History
1# celld documentation
2
3celld is a stateful distributed system. It runs server-side JavaScript on
4your machines, and it stores the long-term state in a bucket that you own:
5S3-compatible, Google Cloud Storage, or Azure Blob Storage. The JavaScript
6API and the configuration follow Cloudflare Workers: Workers, Durable
7Objects, KV, Queues, D1, R2, Workflows, Cron Triggers, and static assets.
8
9In Cloudflare terms, a cell is a Durable Object: a small server with a
10name and a private SQLite database. You make one cell for each user, each
11document, each chat room, or each AI agent. A cell serves HTTP, holds
12WebSocket connections, sets alarms, and makes outbound connections. Cells
13share no database, so the application divides into cells from the start.
14Each cell runs on one thread: a second request interleaves only while the
15first awaits, and storage operations are synchronous and never interleave,
16so the data in a cell stays consistent.
17
18You run celld as one process on each machine. That process is a **node**,
19and the nodes that share one bucket are a **fleet**. Any node can serve
20any cell, so you add capacity by starting another node against the same
21bucket.
22
23A cell has the same states as a Durable Object. A **resident** cell is in
24memory: it is **active** while it does work, and **idle** when it waits.
25celld removes an idle cell from memory after `CELLD_IDLE_EVICT_S` seconds
26without work, and earlier under memory pressure or at the residency cap.
27Without `CELLD_IDLE_EVICT_S`, an idle cell stays in memory until pressure
28or the cap removes it. A cell that then keeps its
29hibernatable WebSocket clients, and stays on its node, is **hibernated**.
30A cell that no node holds is **inactive**. An inactive cell is only an
31object in the bucket, so it costs almost zero, and every cell starts in
32this state.
33
34A cell keeps no memory across these transitions, so the constructor
35runs again on the next event. A hibernated cell wakes the same way a
36cold start does, except that its WebSocket clients stay connected and
37it stays on its node.
38
39One 8 GB node holds 1,000 resident cells, so one resident cell costs
40approximately $0.05 each month.
41
42Exactly one node serves a cell at a time. The nodes do not elect a leader
43or keep a membership list: a node claims a cell by writing a small record
44to the bucket, and it writes that record with a condition the storage
45enforces — the write succeeds only if nobody else changed the record
46first. Object storage therefore decides who wins, and two nodes cannot
47both claim the same cell. The claim expires unless the node keeps
48renewing it, so a machine that dies releases its cells without anyone
49having to declare it dead.
50
51celld does not answer a write until the data survives a failure, so no
52write you were told succeeded is ever lost. That guarantee is called
53RPO=0, for a recovery point of zero.
54
55How celld earns it depends on how many nodes you run. One node writes the
56data to the bucket first, which costs one storage round trip. Two or more
57nodes are faster: the node serving the cell sends each write to another
58node as well, and answers as soon as that node has the data on its own
59disk. celld uploads the data to the bucket afterwards, so the bucket
60still holds the long-term state. Run two or more nodes if write latency
61matters to you; a single node has nobody to send to, so every write waits
62for the bucket. `CELLD_DURABILITY` selects this behavior and defaults to
63`fleet`.
64
65When a node stops, another node takes the cell over. It first collects
66whatever the stopped node had not uploaded yet, so the takeover starts
67from a complete history. The [guarantees](guarantees.md) page
68gives the full mechanism and the exact properties that the bucket must
69provide.
70
71When an event sets an alarm before its response boundary, celld does not send a
72successful response until a durable wake entry covers the alarm. celld does
73not let a later `waitUntil` alarm delay another event's response.
74Each committed installation requires its own publication PUT, including an
75alarm that moves later within the same minute. Each entry has a separate
76identity, so delayed processing of an older alarm state cannot remove the
77entry that covers a newer alarm.
78
79A hibernated cell fires its alarm on the node that owns it. One node in the
80fleet holds the waker role at a time. The waker reads the due wake entries of
81the whole fleet, and it wakes only the cells whose owner node has stopped. Every
82other node wakes only its own hibernated cells, so the alarm load of the fleet
83does not queue on one node.
84
85## What do you build with cells
86
87A cell fits a workload that divides into named, stateful units:
88
89- **Real-time applications.** A multiplayer game, a chat room, or a
90 collaborative document is one cell. The cell holds the WebSocket
91 connections and the state of one room, so the room needs no lock and
92 no external message bus.
93- **Agents.** Each AI agent is one cell. The cell holds the memory, the
94 schedule, and the inbox of one agent in its own SQLite database. An
95 inactive agent has no resident process, so a large agent fleet costs
96 almost nothing between events.
97- **Sharded web applications.** One cell for each user, each tenant, or
98 each device shards the application from the start. The contention of
99 one shared database does not appear, because no shared database
100 exists.
101
102## Contents
103
104- [What do you build with cells](#what-do-you-build-with-cells)
105- [Install](#install)
106- [Configure object storage](#configure-object-storage)
107- [Deploy an application](#deploy-an-application)
108- [Operate D1 and KV](#operate-d1-and-kv)
109- [Start a node](#start-a-node)
110- [Add nodes](#add-nodes)
111- [Shut down and roll out a node](#shut-down-and-roll-out-a-node)
112- [Diagnose a fleet](#diagnose-a-fleet)
113- [List Durable Objects](#list-durable-objects)
114- [Environment variables](#environment-variables)
115- [Cloudflare compatibility](cloudflare-compat.md)
116- [What celld guarantees](guarantees.md)
117- [Limitations](limitations.md)
118- [Security](security.md)
119- [Telemetry](telemetry.md)
120- [Testing](testing.md)
121- [WebAssembly](wasm.md)
122
123## Install
124
125The installer downloads the `celld` binary. Replication runs inside the
126celld process, so a node needs no external replicator.
127
128```sh
129curl -fsSL https://celld.dev/install.sh | sh
130```
131
132If the installer tells you, add `~/.local/bin` to `PATH`. To install one
133exact release, set `CELLD_VERSION` to its tag, for example `v0.0.1`; to
134go back, run the installer again with the previous tag. The releases are
135on [GitHub](https://github.com/denoland/celld/releases), and each release
136has a GitHub Actions build attestation: verify a downloaded file with
137`gh attestation verify <asset> --repo denoland/celld`.
138
139## Configure object storage
140
141The `s3://`, `gs://`, and `az://` scheme names are case-insensitive.
142celld ignores leading and trailing whitespace in `CELLD_BUCKET`.
143
144For an S3-compatible bucket, celld uses the standard AWS credential
145chain. Paged restores also use this chain, so an EC2 instance role does
146not require static access keys for a large cell. On Amazon EKS, celld
147reads the Pod Identity credentials from the injected environment
148variables and the authorization-token file. For Cloudflare R2: create
149a bucket, create an S3 API token with access to
150that bucket, and set these variables:
151
152```sh
153export AWS_ACCESS_KEY_ID=...
154export AWS_SECRET_ACCESS_KEY=...
155export AWS_REGION=auto
156export S3_ENDPOINT=https://ACCOUNT_ID.r2.cloudflarestorage.com
157export CELLD_BUCKET=s3://YOUR-BUCKET
158```
159
160For Google Cloud Storage, celld uses Application Default Credentials.
161Create a bucket. Then authenticate with `gcloud auth application-default
162login`, or point `GOOGLE_APPLICATION_CREDENTIALS` at a service-account
163key that has access to the bucket. Then set the bucket:
164
165```sh
166export CELLD_BUCKET=gs://YOUR-BUCKET
167```
168
169A `gs://` bucket takes no `S3_ENDPOINT` and no `AWS_*` credentials, and
170celld ignores the storage region. On a Compute Engine instance, celld can
171use the attached service account, but the access scopes of the instance
172cap this credential, and the default scope permits only storage reads.
173Create the instance with the `cloud-platform` scope, so the IAM role of
174the service account controls the access.
175
176For Azure Blob Storage, the bucket NAME is the container, and the
177storage account comes from the environment. Create a container. Then
178set the account and one credential:
179
180```sh
181export AZURE_STORAGE_ACCOUNT_NAME=YOUR-ACCOUNT
182export AZURE_STORAGE_ACCOUNT_KEY=...
183export CELLD_BUCKET=az://YOUR-CONTAINER
184```
185
186celld accepts three Azure credential families — a storage account key, a
187managed identity, and a workload identity — and you must configure
188exactly one. A system-assigned managed identity needs only the account
189name. A user-assigned managed identity needs exactly one selector among
190`AZURE_CLIENT_ID`, `AZURE_OBJECT_ID`, and `AZURE_MSI_RESOURCE_ID`,
191because two selectors can name two different identities. An identity
192must hold the Azure Blob data-plane permission to read, write, list, and
193delete blobs; the built-in
194[`Storage Blob Data Contributor`](https://learn.microsoft.com/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor)
195role supplies it.
196
197celld reads a managed identity from the Azure instance metadata service,
198which an Azure VM and an AKS node supply. Azure App Service and Azure
199Container Apps supply a different endpoint, so a managed identity does
200not work there; use a workload identity or an account key instead. The
201standard AKS workload identity environment (`AZURE_AUTHORITY_HOST`,
202`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_FEDERATED_TOKEN_FILE`)
203works with the public authority host, `https://login.microsoftonline.com`,
204with or without a trailing slash; celld rejects a sovereign or custom
205host. celld also rejects each recognized Azure configuration variable
206outside these families — another credential source, an endpoint override,
207the OneLake endpoint — and it ignores an `AZURE_*` name that
208`object_store` 0.12 does not recognize, because that name cannot change
209the client.
210
211An `az://` bucket takes no `S3_ENDPOINT` and no `AWS_*` credentials, and
212celld ignores the storage region. celld qualifies an `az://` bucket for
213a production fleet. The startup test verifies the conditional writes and
214ranged reads. A live Azure test from 2026-08-18 covers the multipart upload
215path. See [guarantees](guarantees.md). For local development against Azurite,
216set `AZURE_STORAGE_USE_EMULATOR=true`; Azurite is a development store, so
217celld does not qualify it for a fleet either.
218
219The bucket credentials give full control of the fleet, so keep them
220safe. The bucket contains the deployments, the SQLite replicas, the
221ownership records, the node leases, and the peer-authentication secret.
222
223A bucket value can add a key prefix: `s3://YOUR-BUCKET/PREFIX`. Every
224object of the fleet then goes below `PREFIX/`, so two fleets can share one
225bucket. A bucket value without a prefix keeps the objects at the root of
226the bucket, therefore an existing fleet does not move its data.
227
228The store must provide conditional writes. A ranged read must return the
229exact requested bytes. The store must also provide read-after-write
230consistency. Cell ownership and stored data depend on these properties.
231Amazon S3, Cloudflare R2, Google Cloud Storage, Tigris, and Azure Blob Storage
232qualify; Backblaze B2, Hetzner, and DigitalOcean Spaces do not. MinIO
233(the community edition) passes the storage test, but celld has not
234qualified it for production; do not use RELEASE.2025-09-06T17-38-46Z,
235which rejects the conditional create that the first deploy sends
236(denoland/celld#162). See [what celld guarantees](guarantees.md) for the
237exact requirements.
238
239## Deploy an application
240
241If the project contains Worker code, install `esbuild` on `PATH`; an
242asset-only project does not need it. Then run `celld deploy` from an
243applicable Wrangler project:
244
245```sh
246git clone https://github.com/denoland/celld
247cd celld/examples/counter
248celld deploy . \
249 --bucket "$CELLD_BUCKET" \
250 --endpoint "$S3_ENDPOINT" \
251 --region "$AWS_REGION"
252```
253
254`celld deploy` accepts module Workers, Durable Object bindings, service
255bindings, variables, cron triggers, D1 databases, KV namespaces, Queues,
256R2 buckets, Workflows, WebAssembly modules, and static assets. An asset project can include a
257Worker or be asset-only, and the asset functions include the assets
258binding, HTML handling, not-found handling, worker-first routes,
259`_headers`, and `_redirects`. If the Wrangler configuration contains an
260unknown key, the deploy stops with an error. See the
261[Cloudflare compatibility](cloudflare-compat.md) page for the complete
262deployment boundary.
263
264A new deployment manifest records the full SHA-256 digest of each JavaScript
265or WebAssembly module. A node verifies each module before it builds the
266deployment, so changed module bytes cannot become active. A node also accepts
267a legacy 16-character digest and verifies that prefix, so an upgrade can load
268an existing deployment.
269
270A running node does not restart for a new deployment. Each node reads
271`deploy/current.json` every 30 seconds (`CELLD_DEPLOY_POLL_S`) and adopts
272a new deployment in place, and `POST /reload` on the internal listener
273makes a node adopt the pointer now. A node builds the new deployment
274beside the one it serves, and then it switches new requests to the new
275deployment in one step. A request that started on the previous deployment
276finishes on it. A deployment that does not build leaves the current
277deployment serving, and the node reports the failure in its log and in
278the `/reload` response. `POST /reload` also rebuilds an unchanged
279deployment.
280
281A Durable Object that is not resident runs the new deployment at its
282next activation. A resident Durable Object moves to the new deployment
283at a safe point: no request runs in it, no alarm handler runs in it, no
284output waits for durability, and no regular WebSocket is open. A request
285that arrives while the object moves waits for the new code. The move
286keeps the object's storage, its epoch, and its hibernatable WebSockets,
287and it does not read or write the bucket. An object that reaches no safe
288point in `CELLD_DEPLOY_MAX_AGE_S` seconds (default 60) is forced: celld
289cancels its running work and closes its regular WebSockets with code
2901012, which is what a Cloudflare deployment does to every object. A
291value of 0 forces every resident object at the adoption. In this window,
292a request on one deployment can call a Durable Object on the other, so
293two adjacent versions must accept each other's calls. The `/state`
294response reports the deployment a node serves, the deployments it still
295drains, the objects that are moving, and the deployment each resident
296object runs.
297
298## Develop an application locally
299
300Run `celld dev` in a Wrangler project:
301
302```sh
303celld dev
304```
305
306The command opens a local object store, deploys the application, and starts
307one celld node. It does not require Docker or a cloud bucket. The supervisor
308stops the node when the command finishes or returns an error. On Linux, the
309kernel also stops the node if the supervisor exits abruptly.
310
311The Worker listener uses `http://127.0.0.1:9876` by default. Use `--port` to
312select a different port:
313
314```sh
315celld dev --port 3000
316```
317
318Use `--host` to select the Worker listener interface:
319
320```sh
321celld dev --host 0.0.0.0
322```
323
324A non-loopback IP exposes the Worker listener to the network. The internal
325operator listener stays on loopback, so another machine cannot use its
326operator API.
327
328The default display uses color to identify each status and the application
329URL. It hides the node warning and information logs, so the errors and the
330listener remain easy to find. Use `--logs` to show these logs:
331
332```sh
333celld dev --logs
334```
335
336Set `NO_COLOR` to disable color. Set `FORCE_COLOR` to enable color when
337the output is not a terminal. `NO_COLOR` always takes priority when both
338variables are set.
339
340You can also give the command a project directory or a Wrangler
341configuration file:
342
343```sh
344celld dev ./examples/counter
345```
346
347The command reads a `.dev.vars` file beside the Wrangler configuration, as
348`wrangler dev` does. Each line of the file has the form `NAME=value`. A
349value can be wrapped in double or single quotes, and the command removes
350the quotes. The command does not read the other dotenv features, such as a
351comment after a value or a value on more than one line. An entry becomes a
352Worker variable, and it overrides an entry of the same name in the `vars`
353of the configuration. Only `celld dev` reads the file, so a local
354credential does not reach a fleet through `celld deploy`. Add `.dev.vars`
355to the application's `.gitignore` file. A change to the file rebuilds the
356application, so a new value takes effect without a restart. The command
357writes each value into the local deployment record under `.celld/dev`, and
358`--clean` deletes that record.
359
360The command stores the local objects and the celld work files in `.celld/dev`
361below the project directory. Add `.celld/` to the application's `.gitignore`
362file. A normal shutdown keeps this directory, so the next invocation uses the
363same durable application state.
364
365This persistence holds across a configuration change, and celld does not
366migrate the stored state to match the new configuration. An object therefore
367keeps a value that the previous configuration wrote, and the application can
368reject that value and fail. The error names the stored value and not the
369configuration, so the failure can look unrelated to the change you made. Use
370`--clean` to start the command from an empty local state:
371
372```sh
373celld dev --clean
374```
375
376The flag deletes `.celld/dev` before the server starts, and it deletes nothing
377else below `.celld`. The command reports the outcome on the console. An absent
378`.celld/dev` directory is the wanted result, so the flag succeeds on a project
379that never ran `celld dev`.
380
381The command does not expose the local object store through a fleet flag. A
382regular node or an operator subcommand must use a supported cloud bucket.
383
384The command watches the project directory. A source or configuration
385change builds a new deployment and restarts the local node. The current
386application continues to run during the build, and a failed build does
387not replace it. The restart retains the durable application state.
388
389A read of a project file is not a change, so a tool that only reads the project
390does not start a build.
391
392The watcher ignores `.celld`, `.git`, `.wrangler`, `node_modules`, and `target`
393directories at each depth. Use `--watch-ignore PATTERN` to ignore an additional
394project-relative glob, and repeat the option to add more globs. The
395`--watch-ignore` option cannot be used with `--no-watch`. Use `--no-watch` to
396disable all automatic builds and restarts.
397
398The watcher does not watch a source file outside the project directory. Worker
399projects need `esbuild` on `PATH`, and asset-only projects do not need it.
400
401## Operate D1 and KV
402
403`celld d1` runs SQL and migrations against a deployed D1 database. The
404command uses the fleet bucket to find a node, and the node routes the
405operation to the database cell.
406
407```sh
408celld d1 migrations apply ledger --bucket "$CELLD_BUCKET"
409```
410
411The `migrations_dir` value must be a relative path inside the project. An
412absolute path or a path with a `..` component is invalid.
413
414`celld kv` reads and writes a deployed KV namespace. The bulk commands use
415the Wrangler file format, so `wrangler kv bulk get` can export data for
416`celld kv bulk put`.
417
418```sh
419celld kv bulk put sessions wrangler-export.json --bucket "$CELLD_BUCKET"
420```
421
422`celld kv bulk get` writes each row before it reads the next value, so the
423command does not retain the complete namespace. A named output file changes
424only after the export completes. If a stdout export fails, the output remains
425an incomplete JSON array and a consumer cannot import it as a complete export.
426
427`celld kv list` prints at most 1000 keys, because a namespace can hold
428many more keys than an operator wants to read. The command reports on
429stderr that more keys exist, and it gives the `--after KEY` that continues
430the listing. Pass `--all` to read every key, or `--json` for one JSON
431object per key.
432
433Every celld command writes its data to stdout and its messages to stderr,
434so a redirect or a pipe carries only data:
435
436```sh
437celld kv list sessions --all --json --bucket "$CELLD_BUCKET" > keys.ndjson
438```
439
440`celld --help`, `celld --version`, and the listener announcements use the same
441stdout sink. The sink treats a closed pipe as a successful stop, and it reports
442all other write and flush errors.
443
444## Start a node
445
446For local development, the default listener is sufficient:
447
448```sh
449celld \
450 --bucket "$CELLD_BUCKET" \
451 --endpoint "$S3_ENDPOINT" \
452 --region "$AWS_REGION"
453```
454
455For a fleet node, bind the public and internal listeners separately. The
456ingress can reach the public listener, and the other nodes can reach the
457internal listener:
458
459```sh
460celld \
461 --bucket "$CELLD_BUCKET" \
462 --endpoint "$S3_ENDPOINT" \
463 --region "$AWS_REGION" \
464 --listen 0.0.0.0:8080 \
465 --internal-listen 10.0.0.12:8081 \
466 --advertise node-a.internal:8081
467```
468
469An explicit advertised address requires an explicit internal-listener
470address: set both command-line options, or their equivalent environment
471variables. celld also rejects an explicit non-loopback public listener
472without an explicit internal listener, because that shape identifies an
473obsolete one-listener configuration.
474
475celld cannot verify that an advertised hostname or a translated port
476reaches the internal listener. You must route the advertised address to
477the internal listener, and you must not route it to the public Worker
478listener.
479
480## Add nodes
481
482Start each node with the same bucket settings. Give each internal listener
483a different address that the other nodes can reach, and set `--advertise`
484to that address. The nodes find each other through the leases in the
485bucket; there is no join command and no fixed membership list.
486
487The bucket supplies discovery and authority, not network reachability.
488Cell fetch and RPC traffic has a protocol version but has no content
489signature, so the private network and its code are the security boundary.
490Peer-control and reserved-cell operator requests use the fleet HMAC, but celld does not
491terminate TLS. Put the advertised addresses on a private network that you
492trust, or use an encrypted overlay such as WireGuard or Tailscale. The
493internal listener also has an unauthenticated operator API, so it must not
494reach the public internet. See the [security](security.md) page for the
495complete boundary.
496
497The listener that receives a request decides where a new cell activates,
498so a load balancer must include a new node in its rotation. A node below
499its residency cap keeps every cell that activates on it. A node at its
500cap, and a node that sheds under memory pressure, hands the activation to
501the peer with the lowest load, and an empty node wins that comparison. A
502shed eviction releases the ownership record
503(`CELLD_PRESSURE_OWNERSHIP=release`, the default), so the next request
504can move the cell. An idle eviction keeps the ownership record, so an
505idle cell wakes on its own node. The node proves the cell durable before
506it stops the runtime, and the cell answers requests through that proof. A
507request that arrives before the stop therefore cancels the eviction, and
508the cell keeps its runtime and its epoch. A bucket proof confirms the
509cell's objects before the stop, so it makes this first window longer than
510a fleet proof does. A request that arrives during the stop can also keep
511the epoch. The node stops the runtime, and then it writes a handoff
512snapshot to the bucket. Before that write the node has published nothing,
513so it gives the cell back and starts it again on the same database at the
514same epoch. After that write the snapshot is the restore source for the
515next owner, so a request waits for the cell to start again at a new
516epoch. The two durability postures behave the same way during the stop,
517because both write the same snapshot at the same point. An idle eviction
518must stop the runtime within `CELLD_OPERATION_DEADLINE_MS`. If the
519runtime does not stop in time, the node keeps the cell resident at its
520current epoch. The node waits one more idle period before the next
521attempt, and it waits the same period after it gives a cell back.
522
523A new node also receives existing idle cells. Every node reads a shared
524fleet sample every five seconds (`CELLD_REBALANCE_INTERVAL_MS`; `0`
525disables balancing). One node claims each refresh through a conditional
526write and reads the node leases for the fleet. The other nodes read
527the result from `fleet/capacity-v1.json`. A node judges the leases in a
528sample at the moment the sample was taken, because the copied leases age
529while the nodes renew the originals. A sample expires after one
530configured interval. A node that reads during a refresh keeps the
531previous sample while that sample is less than three intervals old. A
532refresher that fails puts the previous sample back, so the next reader
533refreshes at once. A refresher that stops holds its claim for three
534intervals, or for 30 seconds if that period is shorter. This claim
535lifetime does not exceed the maximum accepted age of a previous sample.
536A stopped refresher can leave the other nodes without a sample until the
537claim expires. An unavailable sample stops balancing and closes the
538bucket-format gate.
539With balancing disabled, the format check still reads the shared sample
540every five seconds. A node that hands an activation to a peer reads the
541same shared sample, so a burst of activations at a full node costs one
542read each. Readiness, a drain, follower recruitment, and lease authority
543read the node leases directly.
544
545Each node has an ownership target: the fleet's owned cells, divided in
546proportion to the node weights
547(`CELLD_PLACEMENT_WEIGHT`, default: the CPU count). The node with the
548most owned cells per unit of weight hands at most 32 idle cells
549to the peer that is furthest below its
550target, and it hands over no more cells than the receivers have room
551for. A receiver fills to 2% below its target, so a stale sample cannot
552make two nodes trade the same cells. Only a hibernated cell moves. Its
553move is one ownership record write and one signed acquire, it stays
554hibernated on the new owner, and its parked hibernatable WebSockets close
555with code 1012 so the clients reconnect to the new owner. A resident cell
556does not move: it hibernates through idle eviction first
557(`CELLD_IDLE_EVICT_S`) and moves after. Therefore a fleet without idle
558eviction balances only the cells that hibernate on their own. A request
559that arrives for a moving cell waits for the new owner and then follows
560the normal route to it. A node that drains receives no cell, and a node
561with cold activations queued behind its activation ceiling (`restoring` in
562its lease) receives no cell until that backlog clears. The fleet moves nothing while a
563node reports a lease without a weight, so a rolling upgrade to this
564version completes before the first move. An operator can pause the fleet with
565`POST /rebalance/pause` on the internal listener of any node.
566
567## Feed an autoscaler
568
569celld does not scale itself. An external system starts and stops the
570nodes, and celld hands the cells off. Two surfaces report the numbers
571that a scaling decision needs.
572
573Each node writes its lease to `nodes/<node>.json` in the bucket, and
574each renewal refreshes it (`CELLD_TTL_MS`, default 10000, renewed at
575one third of the lifetime). The lease carries a load block:
576`owned_cells`, `placement_weight`, `resident_cells`, `host_websockets`,
577`rss_bytes`, `in_use_bytes`, `cpu_percent_x100`, `open_fds`, `pressured`,
578`memory_headroom`, `shed_cells`, and `restoring`. A script can read these
579objects with the
580bucket credentials alone, and `sampled_ms` dates each sample. The
581`owned_cells` value includes the dormant cells and the cells that are waking
582from dormancy. A started node omits the value until it has read the
583ownership record of every cell on its own disk, so a restarted node does
584not report an empty node while it still owns its hibernated cells. The
585`resident_cells` value includes only the cells that consume the local
586runtime capacity.
587
588The internal listener answers `GET /state` with the live counters:
589`owned_cells`, `occupied`, `capacity_waiting`, `activation_waiting`, `restoring`,
590`shedding`, and the memory values. The `handed_off` counter is the number of
591cells this node gave to a peer, `rebalanced` is the part of that number
592that balancing moved, and `rebalance_failed` is the number of balancing
593moves that no peer acquired. A positive `capacity_waiting` means
594that the node queues activations behind its residency cap, and that is
595the direct signal to add a node. A `pressured` lease is the memory form
596of the same signal. Scale down only when every remaining node reports
597`memory_headroom` and a small `restoring` backlog. A drain into a fleet
598without spare capacity parks the cells dormant on the survivors, and
599each later activation must then shed a resident cell to run.
600
601The `remote_route_refreshes` counter counts cached owner or capacity routes
602that expire and start a new lookup. It increases once for each retired
603route, so it also increases during normal lease renewal. An adoption
604without a lease and an explicit invalidation do not increase it.
605
606The public `/.well-known/celld/health` path stays a boolean. It reports
607503 during a drain and before a joining node settles, so an
608orchestrator can gate a rolling update on it, but it carries no
609utilization number.
610
611## Shut down and roll out a node
612
613celld shuts a node down gracefully on SIGTERM or SIGINT, the signals that
614`systemctl stop`, `docker stop`, and a Kubernetes pod delete send. The
615`/.well-known/celld/health` path reports the node as unhealthy, so a load balancer
616stops public routing to it. New public requests receive a 503 response,
617and celld closes each connection so the client can retry on a healthy
618node. The node finishes the public HTTP requests that it accepted before
619shutdown, and it continues to accept versioned peer traffic for cells that
620it has not handed off.
621
622You must set a longer orchestrator stop grace, such as systemd
623`TimeoutStopSec` or Kubernetes `terminationGracePeriodSeconds`. The grace
624must cover the drain-token wait, the expected complete handoff, and one
625no-progress interval (the settings below). Otherwise, the orchestrator
626can send SIGKILL before celld completes the handoff.
627
628The handoff works in batches. The node reserves a batch of cells and
629stops new local routes to them: an accepted request stays local until it
630finishes, and a new request waits for the successor route. The node
631also cancels each firing alarm in the batch. The alarm runtime records a retry
632and arms its wake entry, so the successor can run the alarm at least once.
633The node cancels an active internal fetch or RPC handler before the durability
634proof, so a Queue broker cannot retain the batch until the process stops.
635The node proves the batch durable in the live durability ensemble, and it
636then closes each database. The node publishes one full L9 snapshot of the
637closed database and verifies that the bucket contains a restore object. The
638successor therefore does not replay the complete transaction history. If the
639snapshot fails, the node materializes the additive L0 chain within the same
640durability deadline. A database larger than the deadline can upload, 80 MiB
641at the default deadline of 10 seconds, skips the snapshot and hands off
642through its L0 chain at once, and a snapshot that fails once is not retried
643for that cell. The node does not release the cell unless one complete
644restore path is visible. The node then releases each ownership
645record and asks a
646compatible peer to acquire it. The peer acknowledges after the ownership
647update and keeps the cell dormant, so the handoff does not restore an
648unused runtime; a later request starts the cell under the peer activation
649limit. The donor starts the next batch after each acknowledgement.
650
651celld orders the resident cells by their local request count. The newest local
652request ID resolves an equal count, and the cell ID resolves an unused cell.
653Therefore, a total stop bound moves shared resources before one-time resources.
654
655`CELLD_RELEASES` limits the complete handoffs in progress (default 128).
656Each handoff includes activity cancellation, a durability proof, a final
657snapshot, an ownership release, and a successor update. `CELLD_ACTIVATIONS`
658limits the demand-driven restores and the startup work.
659
660`CELLD_SHUTDOWN_TOTAL_MS` sets the complete process stop bound (default
66140000 ms). The orchestrator stop grace must exceed this bound, so celld can
662finish its local durability shutdown. celld derives its internal waits from
663this one value. The token wait is three quarters of the bound (default
66430000 ms). The handoff no-progress interval is five eighths of the bound
665(default 25000 ms), with a minimum of one millisecond. Fractional milliseconds
666are rounded down before the minimum applies.
667
668Each successor acknowledgement restarts the no-progress interval. The total
669stop bound still limits the complete shutdown, so progress cannot extend the
670process lifetime beyond the configured grace. A handoff reserves the smaller
671of one second and ten percent of the total bound for the drain-token release.
672A same-node preserve operation uses the no-progress interval as its semantic
673limit because it has no successor acknowledgements. The token-release reserve
674does not apply to a same-node preserve.
675
676celld rejects the removed `CELLD_SHUTDOWN_DRAIN_MS` and
677`CELLD_DRAIN_TOKEN_WAIT_MS` variables at startup. Remove these variables and
678set only `CELLD_SHUTDOWN_TOTAL_MS` when the default total bound is unsuitable.
679The `CELLD_PACED_HANDOFF` switch is also removed. A bucket-backed node
680attempts ownership handoff within this budget. If no successor can accept
681the cells, the existing no-progress and total stop bounds still apply.
682
683Simultaneous stop signals do not flood the surviving nodes. A draining node
684claims a fleet drain token before it releases cells, so concurrent donors
685hand off one node at a time. A donor that cannot claim the token within its
686derived wait proceeds without it because the orchestrator grace is finite.
687The token is advisory: a dead holder's claim expires, and a handoff without
688the token is still safe.
689
690A fresh process also holds its first healthy response until the fleet is
691settled. The process requires its live node lease, no active donor, and memory
692below every pressure low watermark on each live node. A donor records each
693node's restore backlog before it releases ownership. The replacement permits
694one `CELLD_ACTIVATIONS` budget above each recorded value. The incumbent
695ownership counts must remain within one equal successor share above the fleet
696mean. A joining process can satisfy this condition when it advertises paced
697handoff support and owns fewer cells than the busiest incumbent. The process
698publishes this successor capacity before readiness, so an idle rollout can
699repair the ownership distribution during the next donor handoff.
700
701An initial spare has no drain token, so it has no rollout restore baseline to
702check. It still requires memory headroom and acceptable ownership distribution.
703
704An older peer does not publish the low-watermark result, so the gate uses that
705peer's pressure latch during a mixed-version update. An unreadable fleet or an
706unsettled condition keeps the process unhealthy until the condition clears.
707`CELLD_READY_FLEET_GATE_MS` sets the observation deadline in milliseconds
708(default 120000; `0` disables the gate). celld emits `ready_gate_expired` once
709at that deadline, but readiness stays closed. Set an orchestrator rollout
710deadline so a persistent capacity problem fails the rollout. After the first
711healthy response, fleet state does not remove readiness again.
712
713A deadline-cut handoff can leave a node-log recovery for the replacement.
714One process reads and uploads that dead session, and the other processes wait
715for its result. A waiting process can replace an unresponsive recovery after
71630 seconds, so a failed recovery cannot block the fleet permanently. A
717recovery store error keeps the session unsealed, so a later recovery must read
718every retained bundle before the replacement can restore the acknowledged
719state.
720
721Recovery records a checkpoint after each group of 32 completed cell epochs.
722A later attempt uses these checkpoints to skip repeated coverage checks and
723uploads for the recorded transactions. Each checkpoint follows the data uploads,
724so an interrupted upload cannot create a checkpoint for incomplete data.
725An unavailable or invalid checkpoint causes recovery to check the cell coverage
726again. A checkpoint write failure does not stop recovery. The checkpoints do
727not replace the follower evidence or the session seal, and different sessions
728continue to recover independently.
729
730The internal listener continues to accept `/state` requests during the
731drain, and the response reports the handoff and restore counters. The
732public health response identifies the active drain with a 503 status.
733
734A remote cell call can resolve an owner generation that a replacement process
735rejects. celld then waits for a different `(node, epoch)` and refreshes the
736route. The wait uses `CELLD_OPERATION_DEADLINE_MS` as its total bound (default
73715000). celld retries only a peer attempt that proves that the handler did not
738start. It does not retry an ambiguous attempt because the handler can have
739completed without returning its response.
740
741A marked stale-owner response to the outer peer tunnel proves that the
742application request did not start. celld can therefore refresh that route for
743an HTTP, an RPC, or a WebSocket request.
744
745An application must keep one stable operation ID when it retries an ambiguous
746fetch, RPC, D1, or service operation. A WebSocket transport cannot move between
747owners, so a client must reconnect and keep the same application operation ID.
748
749To roll out a new version, use the rolling update of your orchestrator:
750stop each node with SIGTERM, wait for its replacement to report healthy,
751then move to the next node. celld paces the cell handoffs inside each node
752shutdown, and the first-readiness gate paces the update against fleet
753recovery, so a deployer does not need a separate fleet-level handoff gate.
754
755Some upgrades are exceptions:
756
757- The upgrade from v0.1.0 to v0.2.0 must not be a rolling update. Stop
758 every v0.1.0 node, then start the v0.2.0 nodes. Two changes require
759 this: v0.2.0 nodes advertise the internal listener, so ownership
760 records that v0.1.0 nodes wrote name an address that v0.1.0 peers can
761 not follow to a v0.2.0 node; and v0.2.0 compacts replicated data into
762 block objects that a v0.1.0 reader can not restore. A fleet must not
763 mix the two versions.
764- The upgrade from v0.2.1 to v0.3.0 can use a rolling update. v0.3.0
765 changes the default durability from `bucket` to `fleet`: a single node
766 keeps the v0.2.1 behavior, and a fleet of two or more nodes activates
767 fleet replication automatically. Stage the v0.3.0 binary on every node,
768 and restart one node at a time. A mixed fleet stays safe, but a v0.3.0
769 node cannot replicate to a v0.2.x peer, so it acknowledges writes
770 through the bucket and retries until the peer runs v0.3.0. Do not start
771 a v0.2.x binary after that node runs v0.3.0 unless the shutdown log
772 contains `node-log close: sealed epoch`. A graceful stop attempts this
773 seal, but a stop under load can leave the record open, and a v0.2.x
774 binary cannot read writes that wait in the replicated log or bundle
775 objects — this downgrade can lose acknowledged writes.
776- The upgrade from v0.3.0 to v0.4.0 must not use a rolling update. Stop
777 every v0.3.0 node, and then start the v0.4.0 nodes. v0.4.0 moves every
778 proxied cell call — the fetch, the RPC, and the WebSocket — onto one
779 tunneled connection that carries plain HTTP, and the peer protocol
780 refuses a different version, so the two versions cannot proxy calls to
781 each other. v0.4.0 also stores each new large KV value under its ownership
782 epoch and writes an epoch-qualified row reference. A v0.3.0 node cannot
783 read that reference, so a mixed fleet can make a committed KV value
784 unavailable. The tunnel establishment carries the version, so a later
785 protocol change can negotiate instead of refuse.
786- The upgrade from v0.4.0 to v0.4.1 can use a rolling update. v0.4.1
787 restores a large cell by paging, and a paged epoch continues the chain
788 of the epoch before it instead of opening with a whole-database snapshot.
789 A v0.4.0 node cannot restore such an epoch. Each v0.4.1 node therefore
790 publishes the bucket format it reads in its lease, and it pages a
791 takeover only while every live lease reads that format. A v0.4.1 node in
792 a mixed fleet clones a large cell the way v0.4.0 does, and paging starts
793 on its own one lease lifetime after the last v0.4.0 node stops. Do not
794 start a v0.4.0 binary after that point: a cell that paged in has no
795 epoch a v0.4.0 node can restore, and it stays unavailable on that node
796 until a v0.4.1 node takes it over.
797
798The internal listener also provides an alpha operator API. `/state`
799reports the node state, and its `node_load` object is the same load sample
800that the node lease publishes. `POST /reload` adopts the deployment pointer now,
801and `POST /shutdown` starts the same graceful
802handoff. `POST /rebalance/pause` stops balancing. The node publishes the
803pause in its lease, and one paused lease stops every move in the fleet, so
804a pause on one node pauses the fleet. `POST /rebalance/resume` on the same
805node resumes it. The `POST /shutdown?handoff=preserve` request prepares a clean
806same-node reload and keeps the ownership records. celld writes the reload marker
807only after it uploads each stopped database position to the bucket. If an upload
808fails, the next process uses the normal recovery path. A release can change this
809API, so keep the operator tooling and the celld release together.
810
811## Diagnose a fleet
812
813`celld diagnose` reads the node leases in the bucket and sends a probe to
814each live peer. It does not take a lease, and it does not change
815ownership.
816
817```sh
818celld diagnose \
819 --bucket "$CELLD_BUCKET" \
820 --endpoint "$S3_ENDPOINT" \
821 --region "$AWS_REGION"
822```
823
824To probe only some nodes, use `--peer NODE_ID` one or more times. The
825report identifies expired records, unsafe or incorrect advertised
826addresses, peers that it cannot reach, authentication failures, and
827protocol versions that do not agree.
828
829Each node line also shows `restoring`: the count of cold routes that hold
830an activation permit or wait for one (a capacity waiter already holds a
831permit, so each cold route counts once). During a rolling update, wait
832for every node to report `restoring=0` before you restart the next node,
833so one restart's cold work finishes before the next restart removes more
834warm capacity. A node that restarts recovers its previous session's log
835before it takes a lease. If a peer is already recovering that log, the
836node waits behind the peer while the peer's heartbeat is fresh, and it
837takes the recovery over only when the heartbeat stops.
838
839## List Durable Objects
840
841List the Durable Object instances in the bucket:
842
843```sh
844celld cell list \
845 --bucket "$CELLD_BUCKET" \
846 --endpoint "$S3_ENDPOINT" \
847 --region "$AWS_REGION"
848```
849
850Each line is a `Class:ID` cell scope. The ID is the Durable Object ID: a
85164-character hash unless the application supplies its own name. Give a
852class name to list only that class, and pass `--json` for one JSON object
853per line. The command puts the class in the storage prefix, so `--limit`
854applies only to that class. An instance appears after the first event reaches
855it, because its owner then writes an ownership record to the bucket. An ID
856that an application only derives does not appear.
857
858The listing also shows celld's own cells. A D1 database, a KV namespace,
859and a Workflow are each a cell in a reserved class, and their names start
860with `__`. They hold real data in the bucket, therefore the command shows
861them. The `--json` output marks each row with `"reserved": true` or
862`false`, so a script can select one kind:
863
864```sh
865celld cell list --all --json --bucket "$CELLD_BUCKET" |
866 jq -r 'select(.reserved | not) | .scope'
867```
868
869A storage request returns at most 1000 instances, so the command stops at
8701000 instances and writes this line to stderr:
871
872```
8731000 cells shown; more exist. Continue with --after Room:d99d9174b25e46310694dd931b47fbde70a7460bb7b210b546060651ea2ff6e0
874```
875
876Pass that `--after SCOPE` to read the next 1000 instances, or use
877`--limit N` for a different bound:
878
879```sh
880celld cell list --bucket "$CELLD_BUCKET" \
881 --after Room:d99d9174b25e46310694dd931b47fbde70a7460bb7b210b546060651ea2ff6e0
882```
883
884Pass `--all` to read the whole listing in one command. This makes one
885request for each 1000 instances, so it can take minutes on a large fleet;
886the command reports its progress and its request count on stderr.
887
888The order is the storage order, and `--after` continues from the last
889instance printed, so a sequence of `--after` commands lists each instance
890one time. An instance that an application creates during the sequence can
891appear or not appear, because the listing is not a snapshot.
892
893The command writes the instances to stdout and every message to stderr,
894so a script reads only instance data:
895
896```sh
897celld cell list --all --json --bucket "$CELLD_BUCKET" > cells.ndjson
898```
899
900## Hot-cell overload
901
902celld admits a maximum of 64 concurrent fetch events for one Durable Object.
903Set `CELLD_MAX_CELL_REQUESTS` to use a different positive limit.
904
905A Queue broker admits a maximum of 256 concurrent producer calls. It commits
906at most 64 calls in one transaction, and four transactions can overlap their
907durability proofs. These fixed bounds limit the copied message bodies while a
908storage proof is slow.
909
910celld returns HTTP status `503` when the target reaches this limit, and it
911does not start the excess event. The response contains `Retry-After: 1` and
912`X-Celld-Overload: cell`, so the application can retry or reject the work.
913A local or remote Queue owner uses the same status and headers when its
914producer reservations are full. The Queue response body is
915`{"error":"cell admission refused"}`. A fixed-rate client must count the
916response as rejected work, so an immediate retry does not increase the
917configured offered rate.
918
919A caught Queue producer error contains `cell overload: admission refused`, so
920the Worker can return the same admission response to the client.
921
922The runtime writes a `cell_overload_refused` log event when a target becomes
923saturated. The event contains the cell scope, the node, the region, the
924in-flight count, and the limit. Count these overload responses separately
925from the transport errors and the application failures.
926
927## Environment variables
928
929For the full list, run `celld -h`. This table shows the primary settings:
930
931| variable | purpose |
932| --- | --- |
933| `CELLD_BUCKET` | The fleet bucket, and an optional key prefix. The same as `--bucket` |
934| `S3_ENDPOINT` | The S3-compatible endpoint. The same as `--endpoint` |
935| `AWS_REGION`, `AWS_DEFAULT_REGION` | The storage region |
936| `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` | Explicit AWS credentials. The standard AWS credential chain is also available |
937| `GOOGLE_APPLICATION_CREDENTIALS`, `GOOGLE_SERVICE_ACCOUNT_KEY` | Google credentials for a `gs://` bucket. Application Default Credentials are also available |
938| `AZURE_STORAGE_ACCOUNT_NAME` | The storage account for an `az://` bucket. The bucket NAME is the container |
939| `AZURE_STORAGE_ACCOUNT_KEY` | The storage account key. Do not combine it with an identity selector |
940| `AZURE_AUTHORITY_HOST`, `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_FEDERATED_TOKEN_FILE` | The standard AKS workload identity environment for an `az://` bucket. The authority must be the public Azure host |
941| `AZURE_STORAGE_USE_EMULATOR` | Set to `true` to develop against Azurite. celld does not qualify Azurite for a production fleet |
942| `CELLD_ADDR` | The public Worker listener. The same as `--listen` |
943| `CELLD_INTERNAL_ADDR` | The peer and operator listener. The same as `--internal-listen` |
944| `CELLD_ADVERTISE` | The internal address that peers can reach. The same as `--advertise` |
945| `CELLD_UNSAFE_PUBLIC_ADVERTISE` | Set to `1` to permit a literal public IP in `CELLD_ADVERTISE`. This setting does not resolve a DNS name or restrict the internal listener |
946| `CELLD_NODE` | An explicit node-session ID. Use 1 to 128 ASCII letters, numbers, dots, dashes, or underscores. The value cannot be `.` or `..` |
947| `CELLD_WATCH` | The local work directory for SQLite and replication |
948| `CELLD_ESBUILD` | The path of the esbuild executable |
949| `CELLD_ACTIVATIONS` | The limit for concurrent cold-cell activations (default: 8 for each available CPU, at least 16 and at most 128). A cold activation waits on the object store for most of its time, so the default is above the CPU count |
950| `CELLD_DEPLOY_POLL_S` | The interval in seconds at which a node reads the deployment pointer and adopts a new deployment in place (default: 30) |
951| `CELLD_DEPLOY_MAX_AGE_S` | How long a resident Durable Object can keep the previous deployment's code after an adoption before celld forces the move (default: 60; 0 forces at once) |
952| `CELLD_OPERATION_DEADLINE_MS` | The deadline for a non-restore operation (default: 15000) |
953| `CELLD_MAX_CELL_REQUESTS` | The concurrent fetch limit for one Durable Object or Queue broker (default: 64) |
954| `CELLD_MAX_REQUEST_BODY_BYTES` | The body limit for a public Worker request or a direct Durable Object request (default: 1 GiB) |
955| `CELLD_MAX_RESIDENT_CELLS` | The hard limit for resident cells, enforced at admission |
956| `CELLD_IDLE_EVICT_S` | The age in seconds after which an idle resident cell leaves memory and hibernates (unset: only pressure or the residency cap removes an idle cell) |
957| `CELLD_PLACEMENT_WEIGHT` | The ownership share of this node, relative to the other nodes' weights (default: the CPU count) |
958| `CELLD_REBALANCE_INTERVAL_MS` | The interval between shared fleet sample reads and the maximum sample age, in milliseconds (default: 5000; 0 disables balancing) |
959| `CELLD_MAX_RSS_MB` | The memory threshold for pressure shedding, applied to the greater of the allocator-adjusted RSS and the allocator-adjusted active cgroup working set (default: 80% of the available memory; 0 disables the threshold and the absolute cap) |
960| `CELLD_DURABILITY` | How celld proves a write durable before it answers. The default is `fleet`: the node serving the cell sends the write to one or two other nodes and answers once they hold it on disk, or once the bucket upload finishes, whichever comes first. This needs two or more nodes; a single node has nobody to send to, so every write waits for the bucket. Set `bucket` to always wait for the bucket |
961| `CELLD_LOG_PIPELINE` | The limit for fleet log rounds that can be in flight (default: 4) |
962| `CELLD_LOG_HEDGE_MS` | The wait before a leader sends a second copy of a slow log append to a follower. The default is adaptive: celld derives the wait from the slowest recent append in the ensemble (4 times that append, at least 250 ms, and always below the eviction backstop), so a loaded fleet does not send copies for honest slow appends. Set a value to use a fixed wait in milliseconds, and set `0` to disable the second copy. An append is idempotent per sequence, so the copy is safe, and the leader uses the answer that arrives first and confirms |
963| `CELLD_LTX_TRUNCATE_PAGES` | The WAL size, in pages, at which celld truncates an ordinary cell's WAL file at the next checkpoint (default: 128, a 512 KiB cap). A passive checkpoint does not shrink the WAL file, so each capture reads the stale region after a restart. The truncate keeps the read small. A truncate ends in a full image of the database, so a database larger than 4 MiB also waits until its WAL is larger than the database. Queue cells use passive checkpoints only. Set `0` to disable the truncate for all cells |
964| `CELLD_LTX_COMPACTION` | The default is `1`: celld creates additive L1 objects, and a takeover reads tens of objects instead of thousands. Set `0` on every node of a mixed fleet until all nodes can read v0.5.2 block objects, because an old reader cannot take over a cell after its first L1 publication |
965| `CELLD_LTX_COMPACTION_MIN_TXIDS` | The durable TXID distance that queues a background L1 attempt (default: 256) |
966| `CELLD_LTX_COMPACTION_MIN_MB` | The L0 bytes since the last fold that queue a background L1 attempt, in MiB (default: 32, at most 64). The byte threshold lets a cell with large rows compact before it reaches the transaction threshold |
967| `CELLD_LTX_PAGED` | The default is `1`: celld restores a taken-over cell by paging when its chain is at least `CELLD_LTX_PAGED_MIN_MB`. It opens the database through a fault-in VFS that reads each page from the bucket on first use, instead of downloading the whole restore chain first, and a smaller chain is cloned. Set `0` to clone every chain. A paged cell's local file is a cache, so celld does not preserve it as an eviction snapshot and does not publish a handoff snapshot from it. A paged epoch continues the chain it paged in. celld uploads a small marker object at the next transaction before the cell serves, and its later objects follow it, so a restore composes the epochs. Set `0` on every node of a mixed fleet until all nodes run v0.4.1 or later, because a paged epoch holds no whole-database snapshot and a node before v0.4.1 restores one epoch only. Such a node refuses the activation of that cell, and the refusal is permanent for the cell. A full activation opens its epoch with a whole-database snapshot. A node pages only while every live lease in the fleet publishes a bucket format that reads a paged epoch, so a rolling update from a release without paged restore clones until that release has left the fleet; the `paged_gate` log event reports each change. A clean reload does not keep a paged cell resident; the next process pages it in again. An inspect of a paged cell must read the bucket, because celld does not copy the cell's sparse file in place. After the activation, celld fills the rest of the file in the background at `CELLD_LTX_HYDRATE_MBPS`, so a cell that stays resident soon reads only its local file |
968| `CELLD_LTX_PAGED_MIN_MB` | The chain size, in MiB, from which a restore pages instead of cloning (default: 256). A clone of a smaller chain takes seconds and fits the node's memory, so it needs no fault path and no hydration. Set `0` to page every chain |
969| `CELLD_LTX_HYDRATE_MBPS` | The rate, in MiB per second, at which a paged cell's file fills in the background (default: 16). One cell fills at a time per node. Set `0` to keep a paged cell sparse, so every cold page is read from the bucket on first use |
970| `CELLD_LTX_COMPACTIONS` | The node-wide limit for concurrent background L1 attempts (default: 2). `CELLD_RELEASES` bounds final handoff snapshots |
971| `CELLD_LTX_DURABILITY_TIMEOUT_SECS` | The budget for one durability proof, in seconds (default: 10). The budget runs from the moment the node starts to upload the write. A write that waits behind the uploads of other cells waits while the node proves other writes, for at most six budgets. The same budget bounds the final snapshot or L0 fallback of a handoff. A slow object store can need a longer budget for a large write |
972| `RUST_LOG` | The runtime log filter |
973
974Each L1 compaction attempt merges at most 256 source objects. The buffer
975budget for the source data is 64 MiB. If one source object exceeds this
976budget, celld compacts that object through temporary files in the cell's
977local LTX directory. The node must have free disk space for the source copy
978and the output file. The codec keeps the page index in memory, so its memory
979use increases with the page count. Compaction keeps the source objects and
980publishes a continuous L1 range, including when a source overlaps an existing
981L1 object.
982
983`CELLD_OUTPUT_GATE` is removed. Remove the variable from the environment,
984including a value of `1` or an empty value. celld always waits for the
985configured durability proof before it acknowledges a write.
986
987These settings are also removed. Remove them from the environment, including
988an empty value or a value that matches the former default.
989
990| Removed setting | Current behavior |
991| --- | --- |
992| `CELLD_OTEL_SINK` | Set `CELLD_OTEL=1` for the fleet bucket or set `CELLD_OTEL` to the collector base URL for OTLP. |
993| `CELLD_AI_BINDING`, `CELLD_AI_URL` | The experimental AI adapter is removed. Call the provider from application code and remove the AI binding declaration. |
994| `CELLD_CLOUD_RESTART_ON_DEPLOY` | A managed deployment adopts the new code in place. Credential rotation can still restart the process. |
995| `CELLD_STORAGE_PROBE` | A node checks the storage contract before it serves a bucket-backed deployment. |
996| `CELLD_EVICTIONS` | A node runs at most four concurrent evictions. |
997| `CELLD_LOG_CAPTURE_WORKERS` | A node uses at most eight workers for log capture. |
998| `CELLD_REBALANCE_BATCH_CELLS` | A balancing batch moves at most 32 idle cells. The release limit and the receiver capacity can reduce this count. |
999| `CELLD_PRESENCE_SHADOW` | A managed node sends its serving status and its owned-cell count. It does not send a separate bucket comparison. |
1000| `CELLD_LOG_BUNDLE` | Fleet durability uses bundled tiering. A node still uses per-cell uploads when the bucket must prove a write. |
1001| `CELLD_QUEUE_PRODUCER_GROUP_MS` | A Queue owner uses a 4 ms timer to group concurrent producer calls into a SQLite transaction. |
1002| `CELLD_LOG_GROUP_COMMIT_MS` | A node waits 1 ms before a fleet log capture when Queue writes are pending. |
1003| `CELLD_PACED_HANDOFF` | A bucket-backed node attempts ownership handoff within the shutdown budget. Set `CELLD_SHUTDOWN_TOTAL_MS` to match the supervisor grace. |
1004
1005The Queue batching timers do not set a response deadline. A Queue still waits
1006for the wake-entry proof and the configured write durability proof.
1007
1008Fleet uploads combine changes from multiple cells into shared bucket objects.
1009`CELLD_DURABILITY=bucket` still requires a bucket proof for every acknowledged
1010write, even when peers are available. Recovery can read the existing bundles
1011and the per-cell objects.
1012
1013The storage check still distinguishes a contract violation from an ambiguous
1014transport error. A violation prevents startup. After the existing retries,
1015an ambiguous error produces a warning and permits startup.
1016
1017Use `celld diagnose --read-only` to check the bucket leases and the peers.
1018A managed presence report does not prove that a node holds a bucket lease.
1019
1020The help output also shows the advanced tuning switches and their
1021defaults.
1022
1023An unset variable selects its documented default. A Boolean variable
1024accepts only `0` or `1`. celld exits during startup when a supplied value
1025is invalid.