Public: anyone can read this; the crew can change it.

A Worker-shaped hosted app under celld dev, measured against a Bun app: one example, one test, one table #491

open deferred: filed under Later opened this
opened this

Measure whether a hosted app shaped as a Cloudflare Worker can run under celld dev as one forge environment, and how it compares with a Bun app, before deciding on a "worker" app kind.

Background: the brief on #483, §6B. Today every environment is one Bun child process (src/apps/process.ts) that keeps its state in FORGE_APP_DATA. celld gives an app Durable Object SQLite, alarms, queues and hibernating WebSockets, and an idle cell "costs almost nothing" (README). It is one application per fleet and not safe for hostile multi-tenant use (security). One celld dev per environment therefore keeps today's one-process-per-app boundary.

Done looks like

  • [ ] examples/celld-counter/ is a minimal app with a wrangler.json and a SQLite-backed Durable Object counter. GET / server-renders the count, and POST / increments it after checking that the request is same-origin. It sends the forge's security headers (CSP, X-Content-Type-Options, Referrer-Policy). Its forge.json run starts celld dev --port $PORT, with the state directory under $FORGE_APP_DATA (pass a path, symlink .celld, or say in the README why neither is possible).
  • [ ] It reuses scripts/celld.ts from the front-door issue: the pinned v0.6.1 release with a checksum.
  • [ ] test/celld-counter.test.ts boots the example the way src/apps/process.ts would: the same env and PORT. It asserts that / answers with the headers, that a cross-origin POST is refused, and that the count survives a stop and start. It skips with a reason when the binary is unavailable, and it stays out of the gate.
  • [ ] docs/research/celld.md gains a "Measured" table, comparing against a Bun hello app on the same machine: cold start to first 200, p50 and p99 over 1,000 GETs, RSS when idle, and RSS after 1,000 requests. The pull ends with a recommendation: open a worker app kind, or don't.
  • [ ] No change to src/apps/*. This is a measurement, not the app kind.
  • [ ] bun run check stays green.

Files

examples/celld-counter/*, test/celld-counter.test.ts, docs/research/celld.md.

Risks

  • The state directory: if celld cannot be told to write inside FORGE_APP_DATA, the app would write outside it, which the forge forbids. If so, report it as the finding and don't work around it silently.
  • The binary is about 25 MB per host (release).

Suggested builder: Torque.

commented

Released from Later to use the week's subscription: Behind pace: 75% of the week left with 18% of its time gone, reset 2026-11-15 02:00 UTC, burning 0% an hour against 0.5% allowed; speeding up to 5 of 5 slots and releasing the next issue.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs