Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion apps/demo-tasks/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import { Container, getContainer } from '@cloudflare/containers';

export class TasksBoard extends Container {
defaultPort = 8080;
sleepAfter = '2h';
// Matched to the gateways rather than left at the 2h it had. The board is
// ephemeral by design and demo jobs run for seconds, so there is no state
// here worth paying to keep warm — and the gateway forwards every tasks
// call, which keeps this awake for exactly as long as anyone is using it.
// A poll that does land on a cold start gets the 503-and-retry below.
sleepAfter = '15m';
enableInternet = false; // it dials nothing; it only answers
}

Expand Down
14 changes: 8 additions & 6 deletions apps/demo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ const FOLD_CONFIG = {

export class FoldDemo extends Container {
defaultPort = 8080;
// This is now the only thing bounding what the container costs. It used to
// be a backstop — the uptime monitor pinged every 5 minutes, so in practice
// the container never slept — but that monitor is undeployed, so an idle
// hour after one visitor is an hour of provisioned memory and disk on the
// bill. Shorten it to trade a ~1.7s cold start for that tail.
sleepAfter = '1h';
// The only thing bounding what this container costs. It used to be a
// backstop — the uptime monitor pinged every 5 minutes, so in practice the
// container never slept — but that monitor is undeployed, so every idle
// minute after a visitor leaves is provisioned memory and disk on the bill.
// 15m buys the tail back for a ~1.7s cold start on the next visitor, which
// is a fair trade for a demo people arrive at one at a time rather than in
// a steady stream.
sleepAfter = '15m';
enableInternet = true; // fold dials the public upstreams
envVars = { FOLD_CONFIG: JSON.stringify(FOLD_CONFIG) };
}
Expand Down
8 changes: 4 additions & 4 deletions apps/enterprise/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ const FOLD_CONFIG = {

export class FoldEnterprise extends Container {
defaultPort = 8080;
// The same billing lever as the demo's, and the same caveat: the uptime
// monitor that used to keep this warm is undeployed, so this timeout alone
// decides how long an idle container stays on the bill.
sleepAfter = '1h';
// The same billing lever as the demo's, on the same 15m, and with more
// reason to be short: this gateway is behind a sign-in, so it sits idle
// more of the time than the demo does.
sleepAfter = '15m';
enableInternet = true; // fold dials the public upstreams and the issuer's JWKS
envVars = { FOLD_CONFIG: JSON.stringify(FOLD_CONFIG) };
}
Expand Down
Loading