Skip to content

Scale to zero — this service is idle by default - #2

Merged
Sbussiso merged 1 commit into
masterfrom
scale-to-zero
Sep 9, 2026
Merged

Scale to zero — this service is idle by default#2
Sbussiso merged 1 commit into
masterfrom
scale-to-zero

Conversation

@Sbussiso

@Sbussiso Sbussiso commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Self-hosted Command Center installs call this on a ~15-minute background tick. Today, with no self-hosted installs, it serves nothing — the only entries in 24 hours of logs are my own SSH sessions.

The comment justifying always-warm claimed a cold start "would routinely leak into the client's grace-period math." That's off by four orders of magnitude: SENTINEL_LICENSE_GRACE_HOURS is 72 hours, and this service binds its port in ~4s.

Safe for three reasons, all measured rather than assumed:

  1. Boot fits the window. Fly's proxy waits ~8s for an auto-started machine to bind; 4s clears it. Not theoretical — the Sentinel AI agent needs 10s, missed that window, and had every wakeup fail with RemoteDisconnected until it was kept warm.
  2. The caller is more patient than Fly. Command Center's check-in timeout is 10s, longer than the ~8s proxy window.
  3. A miss is free. license_client.py treats network/5xx as "unreachable" and applies the 72-hour grace window — a failed check-in is a designed path, not an error path. The next tick 15 minutes later catches it and no customer notices.

Saves ~$2/month, which isn't really the point — the point is the cost now tracks customers instead of the calendar.

Flips if a license check ever moves onto a user-blocking path (synchronous validation on dashboard load). Then a 4s cold start becomes a 4s page stall. Noted in fly.toml.

🤖 Generated with Claude Code

Called by self-hosted Command Center installs on a ~15-minute background
tick, so it is idle by design. Today, with no self-hosted installs, it
serves literally nothing: the only entries in 24 hours of logs are SSH
sessions.

The comment justifying always-warm claimed a cold start "would routinely
leak into the client's grace-period math". That had the scale wrong by
four orders of magnitude — SENTINEL_LICENSE_GRACE_HOURS is 72 HOURS, and
this service binds its port in ~4s (measured).

Three things make this safe, all verified rather than assumed:

  1. Boot fits Fly's window. The proxy waits ~8s for an auto-started
     machine to bind; 4s clears it. This is not theoretical — the
     Sentinel AI agent needs 10s, missed that window, and had every
     wakeup fail with RemoteDisconnected until it was kept warm.
  2. The caller waits longer than Fly gives up: Command Center's
     check-in timeout is 10s.
  3. A miss is free. license_client.py treats network/5xx as
     "unreachable" and applies the 72-hour grace, so a failed check-in
     is a designed path. The next tick 15 minutes later catches it.

Flips if a license check ever moves onto a user-blocking path — then a
4s cold start is a 4s page stall. Noted in fly.toml.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Sbussiso
Sbussiso merged commit bd364c6 into master Sep 9, 2026
2 checks passed
@Sbussiso
Sbussiso deleted the scale-to-zero branch September 9, 2026 20:55
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