Skip to content

perf(containers): 15m of idle, not an hour and not two - #48

Merged
blakebauman merged 1 commit into
mainfrom
sleep-after-15m
Aug 26, 2026
Merged

blakebauman merged 1 commit into
mainfrom
sleep-after-15m

Conversation

@blakebauman

Copy link
Copy Markdown
Member

The last piece of the container bill. Memory and disk bill on what is provisioned, for every awake second — and with fold-uptime undeployed, sleepAfter is the only thing bounding how long an idle container keeps costing money.

Container Before After
fold-demo 1h 15m
fold-enterprise 1h 15m
fold-demo-tasks 2h 15m

demo-tasks had the longest tail and the least reason for it

The 2h predates the teardown and carries no stated rationale. It is safe to cut:

  • the job board is ephemeral by design — the module docstring says so, and a restart clears it
  • demo jobs run for seconds, so there is no state worth paying to keep warm
  • the gateway forwards every tasks/* call, so the upstream stays awake exactly as long as anyone is actually using it
  • a poll that does land on a cold start already gets 503 demo-tasks is starting, retry in a few seconds from the Worker

What it costs

A ~1.7s cold start for the first visitor after a quiet quarter hour — measured on lite in #46. Fair for a demo people arrive at one at a time rather than in a steady stream. The enterprise gateway has more reason still: it is behind a sign-in, so it idles more of the time than the demo does.

Verified after deploy

  • demo, enterprise, tasks /health all 200
  • tools/list returns 8 tools across cfdocs (2), git (5), jobs (1), no run.fold/partialFailure
  • jobs__start_job still mints through the affinity pin (demo-job-8, run.fold/upstream: demo-tasks)

All three are deployed.

🤖 Generated with Claude Code

Memory and disk bill on what is provisioned, for every awake second, so
with the uptime monitor undeployed this timeout is the only thing
bounding what an idle container costs. All three drop to 15m.

  demo         1h -> 15m
  enterprise   1h -> 15m
  demo-tasks   2h -> 15m

demo-tasks had the longest tail and the least reason for it. The 2h
predates the teardown and carries no stated rationale; the board is
ephemeral by design, demo jobs run for seconds, and the gateway forwards
every tasks call — so the upstream stays awake exactly as long as anyone
is actually using it, and there is no state here worth paying to keep
warm. A poll that does land on a cold start gets the 503-and-retry the
Worker already returns.

The cost is a ~1.7s cold start for the first visitor after a quiet
quarter hour, measured on lite in #46. That is a fair trade for a demo
people arrive at one at a time rather than in a steady stream, and the
enterprise gateway has more reason still: it sits behind a sign-in, so
it is idle more of the time than the demo is.

Verified after deploy: all three healthy, tools/list returns 8 tools
across three namespaces with no partialFailure, and jobs__start_job
still mints through the affinity pin.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@blakebauman
blakebauman merged commit 884492e into main Aug 26, 2026
1 check passed
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