Skip to content

feat(deploy): event-driven pre-warm to cut free-tier cold-start#251

Merged
jsugg merged 1 commit into
mainfrom
feat/prewarm-on-deploy-events
Jul 8, 2026
Merged

feat(deploy): event-driven pre-warm to cut free-tier cold-start#251
jsugg merged 1 commit into
mainfrom
feat/prewarm-on-deploy-events

Conversation

@jsugg

@jsugg jsugg commented Jul 8, 2026

Copy link
Copy Markdown
Owner

What

Event-driven pre-warming of the free-tier production service to cut cold-start latency when a deploy provisions — no fixed-interval cron.

  • scripts/render/prewarm-service.sh — best-effort GET /api/health (retries to wake a sleeping instance), never fails its job (a hibernating service is exactly what we're waking).
  • Wired into genuine events:
    • start of Promote to Production (warm the box seconds before the ref-push that triggers the deploy),
    • start of both rollback workflows (git + Render-native),
    • every push to main via a new Warm Production On Merge workflow (a merge is a leading indicator a promotion is coming).
  • Target overridable via the PRODUCTION_HEALTH_URL variable (defaults to the Render service URL).

Why this shape

A fixed */N cron pinging health is the classic anti-hibernation keep-alive pattern that free hosts detect and can throttle or ban — and on a private repo it also burns Actions minutes fast (per-minute billing rounding makes a <15-min cadence cost ~3000+ min/month). Firing on real CI activity instead is organic, effectively free, and warms the instance precisely when a deploy is imminent. It complements #248 (longer rollout stabilization) rather than replacing it.

…old-start

Wake the free-tier service on genuine CI events instead of a fixed-interval
cron (which reads as an anti-hibernation keep-alive and risks throttling/bans):

- scripts/render/prewarm-service.sh: best-effort health ping, never fails its
  job (a sleeping service is exactly what we are waking).
- Runs at the start of Promote to Production and both rollback workflows, so
  the instance is warm just before the deploy container provisions.
- New Warm Production On Merge workflow pings on every push to main, since a
  merge is a leading indicator that a promotion is coming.

Target is overridable via the PRODUCTION_HEALTH_URL variable.
@jsugg jsugg merged commit d5a7f0c into main Jul 8, 2026
21 checks passed
@jsugg jsugg deleted the feat/prewarm-on-deploy-events branch July 8, 2026 20:56
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