perf(personal-site-2026): tighten startup probe to cut cold start (~5s → ~1s) - #41
Merged
Merged
Conversation
The cloud-run module's startup probe (initial_delay 5s, period 10s) held every scale-from-zero instance "not ready" for a fixed ~5s, even though the compiled Deno binary serves in ~1.7s — pinning cold starts at ~5.1s. Expose the probe schedule as a module variable defaulting to the existing 5/10/3/3 values (no change for any other caller), and override it for personal-site-2026 to 0/1/10/1 so a ready instance is detected in ~1s.
Terraform Plan
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Scope a fast Cloud Run startup probe to
personal-site-2026to cut its cold start.modules/cloud-run: expose the probe schedule as a newstartup_probevariable, defaulting to the existing5 / 10 / 3 / 3values → no change for any other caller (azadi, amazing-landing, hooklab, azadi-go, mocktail-email-auth).apps/personal-site-2026.tf: override toinitial_delay=0, period=1, failure_threshold=10, timeout=1.Why
Measured from Cloud Run logs, every scale-from-zero request was pinned at ~5.1 s across all module-based apps — a razor-sharp cluster, not app-boot scatter. The deployed compiled-binary revision is serving in ~1.7 s, but the probe's
initialDelaySeconds: 5holds the instance "not ready" for a fixed 5 s, then passes on the first attempt:Probing from t=0 every 1 s detects the ready instance in ~1 s;
failure_threshold=10keeps a 10 s startup budget.Scope / safety
personal-site-2026sets the variable; all other module callers inherit the unchanged default → zero diff for them.mocktail.tf/shehryar.tfare untouched.ignore_changesonimagekeeps the current deployed image.terraform fmt -checkandterraform validatepass.Expected plan
One in-place update on
module.personal_site_cloud_run.google_cloud_run_v2_service.default(four probe fields); no other resources change.