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

A forge runs anywhere: a stated footprint, proven on a 1-CPU, 512 MiB machine #12092

Closed opened this has it

Landed in pull #12236 · 7 runs · run

opened this

The owner, 2026-11-13: "the forge is ubiquitous that is the idea. i want it everywhere. even on things with resource constraints."

Today a hosted forge's own process holds about 400 MiB a few minutes after start (measured on the vxrail, one sample), and the top forge 1.7 GiB. Nothing states what a forge may cost, so nothing stops it growing.

What should be true:

  • A forge has a stated footprint: memory at rest, disk for an empty forge, time from start to first page. The numbers are measured on every release and shown in system.
  • One process and one thread is the default shape. Extra threads (the serve/work split) switch on only when the machine has the cores.
  • Nothing a small machine cannot afford is required to serve pages and git: Chromium, the crew's AI tool and a large page cache are optional, and the forge says plainly what is off and why.
  • It runs on ARM (a Raspberry Pi class machine) as well as x86.

Done when: a forge started with 1 CPU and 512 MiB serves its home page, takes a push and runs a check, and the release proof records its memory at rest. First step is the measurement, then the largest holders are cut.

2 earlier comments
commented

Parked by the crew: the check stayed red through 2 automatic tries (pull #12093 closed; its branch mason/12092-a-forge-runs-anywhere-a-stated-footprint at 5deaceb3a67f keeps the work so far). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

try 1: docs/features/footprint.md, src/main.ts, src/release/prove.ts, src/system/footprint.ts, src/system/largest_dirs.ts, src/web/pages/system.ts, test/footpr… try 2: src/release/prove.ts, src/system/footprint.ts, src/system/largest_dirs.ts try 3: test/system-parts.test.ts

commented

Measured 2026-11-13 on isolated forges from the release image (scripts: scratchpad/chaos/scripts/tier.sh, journey.ts), the same first-hour journey at each size (boot, first admin, repo, push, pull, check, merge, deploy, 50 issues, pages):

limitboot to first pageRSS at rest / afterresult
2 CPU / 2 GiB3.5 s172 / 396 MiBpasses
1 CPU / 1 GiB5.3 s175 / 356 MiBpasses
1 CPU / 512 MiB5.8 s170 / 382 MiB (cgroup peak 509)passes, barely
0.5 CPU / 384 MiB10–13 s167 / killedthe WHOLE forge is OOM-killed at "open pull", twice, silently
0.25 CPU / 256 MiB25 s168 / 202 MiBpasses (6 s check)

Findings to fold in here: (1) a cell may take 75% of the pod's memory, leaving no room for the forge's own ~170 MiB: size the cell ceiling from pod memory minus the forge's own use (with FORGE_CELL_MEMORY_MAX_MIB=128 the 384 MiB forge passed); the check should be what dies, never the forge. (2) The launcher is a second Bun runtime of ~50 MiB: running bun src/main.ts directly saves 15 MiB, with --smol 17. (3) The main process holds ~145 MiB anonymous for 3,230 source files loaded at boot: lazy-load what a small forge never uses (TUI, boards, studio…) or bundle. (4) The forge says nothing about being small: /system showed "80 cores" and /api/v1/health reported HOST memory inside a 512 MiB limit: read the cgroup. (5) An empty forge is 42 MB on disk. (6) The image is amd64 only: no ARM yet. FORGE_ENGINE=worker costs 20 MiB, so it stays off on small forges.

commented

Parked by the crew: runs on this issue repeated more than three times in ten minutes, so nothing more starts here until a person says what to try.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs