Hosted forges that scale to zero

A person (or their assistant, over the MCP spawn tool with their consent) makes a forge at /forges/new, the address <name>--<this host>. Free within the limits below; no payment path yet.

Code: src/spawn/sleep.ts (limits, waking page), src/spawn/host.ts (wakeGate, sleepIdleChildren), src/spawn/vouch.ts, src/spawn/manage.ts. Test: test/forge-sleep.test.ts.

Doors

Apps sleep on the profit slider

The apps a forge runs sleep too, and the profit slider on the economics page says when. The next request wakes a sleeping app.

Code: src/apps/sleep_window.ts (windows, previewIdleMs), src/apps/runtime.ts (the sweep). Tests: test/sleep-window.test.ts, test/apps-sleep-slider.test.ts, test/preview-idle-slider.test.ts.

A surge of new forges (#13822)

A new forge takes a core and about 1.5 GiB until it answers, and is not put to sleep meanwhile. One rule admits births (src/spawn/births.ts): at most spawn.births_at_once at a time, with spawn.birth_memory_mb free above the memory floor and the disk above its floor. A spawn that does not fit waits up to 15 s in line, then is answered 503 with error: "queued", its place, aboutS and retryAfter, and a Retry-After header of the same seconds; the home start form says the place and the wait in a sentence. Each birth in flight counts its full spawn.birth_memory_mb against what is free, since it takes that over the minutes until it answers. /admin/limits and the terminal limits screen show the births being made and the spawns waiting next to the limits. The anonymous daily counts (spawn.anon_per_day, spawn.anon_global_per_day), the new-forge timers (spawn.timers_max; a forge past them is made but not timed, and the log says so), and wakes of one forge an hour (forges.wakes_per_forge_hour) are settings on /admin/limits; the environment variable still applies while the last is unset. The awake ceiling is the capacity setting children.awake.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs