Skip to content

Deploy large programs in memory that does not grow with them - #122

Merged
qfeuilla merged 1 commit into
mainfrom
deploy-at-scale
Nov 1, 2026
Merged

qfeuilla merged 1 commit into
mainfrom
deploy-at-scale

Conversation

@qfeuilla

@qfeuilla qfeuilla commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Deploying a large program (82 triggers, a 2 MB @file) ran the dispatcher and the worker out of memory and left the CLI saying only Service Unavailable. This branch makes that work cost the same whatever the program's size, and makes the CLI say what happened.

  • A build names a @file's content (and a text @asset's) by its hash instead of copying the text into the program; the worker reads each content once, only for the part it runs, and keeps it by hash.
  • Trigger cuts are worked out once, at registration, into program_trigger_cut; status, activation, resync and the infra verbs read them. Older builds get theirs filled in at boot. The dispatcher reads the running program only through its bounded cache, and hashes a program without copying it.
  • weft status is one POST that always carries the trigger fingerprints; it now shows triggers gone from the folder and orphaned infra places.
  • On Cloud Run a build's context streams to the bucket in resumable parts, and its temporary folder sits in a capped memory volume.
  • Worker caches are bounded by size. A worker that ran out of memory leaves a note that the next worker turns into "ran out of memory; raise it with weft workers set --memory", kept on the run once it is lost.
  • A recovered run whose program or files cannot be read waits and retries instead of ending; weft workers set retries it at once. A file that is really gone still fails it, naming weft resync.
  • A platform 502/503/504 explains itself and names WEFT_DISPATCHER_MEMORY; reads are sent once more first.
  • weft activate lists the triggers it leaves behind, and --no-build turns triggers on with the registered build. TriggerCopy gains on. tree, freeze and forget-copy no longer sync the folder.
  • Loops keep their port values on their loop-input node only.
  • VS Code extension 0.2.288. CHANGELOG section 2026-11-02 (0.2.288).

… what happened

A build names a @file's content by its hash instead of copying it into the
program, trigger cuts are worked out once at registration, the dispatcher
reads the running program only through its bounded cache, worker caches are
bounded by size, and a worker that ran out of memory says so. weft status is
one POST, a platform 503 explains itself, activate lists the triggers it
leaves behind and takes --no-build, and read verbs no longer sync the folder.
@qfeuilla
qfeuilla merged commit d6ec76d into main Nov 1, 2026
27 checks passed
@qfeuilla
qfeuilla deleted the deploy-at-scale branch November 2, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant