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
11 changes: 11 additions & 0 deletions terraform/apps/personal-site-2026.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ module "personal_site_cloud_run" {
max_instances = 1
health_path = "/"

# The compiled Deno binary is serving in ~1.7s, yet the module's default probe
# (initial_delay 5s, period 10s) holds the instance "not ready" for a fixed 5s,
# pinning every scale-from-zero request at ~5.1s. Probe from t=0 every 1s so a
# ready instance is picked up in ~1s; failure_threshold keeps a 10s boot budget.
startup_probe = {
initial_delay_seconds = 0
period_seconds = 1
failure_threshold = 10
timeout_seconds = 1
}

depends_on = [module.personal_site_identity]
}

Expand Down
8 changes: 4 additions & 4 deletions terraform/modules/cloud-run/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ resource "google_cloud_run_v2_service" "default" {
http_get {
path = var.health_path
}
initial_delay_seconds = 5
period_seconds = 10
failure_threshold = 3
timeout_seconds = 3
initial_delay_seconds = var.startup_probe.initial_delay_seconds
period_seconds = var.startup_probe.period_seconds
failure_threshold = var.startup_probe.failure_threshold
timeout_seconds = var.startup_probe.timeout_seconds
}

liveness_probe {
Expand Down
16 changes: 16 additions & 0 deletions terraform/modules/cloud-run/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ variable "health_path" {
default = "/api/health"
}

variable "startup_probe" {
description = "Startup-probe schedule. Defaults preserve the original behaviour; override per-app to tune cold-start readiness."
type = object({
initial_delay_seconds = number
period_seconds = number
failure_threshold = number
timeout_seconds = number
})
default = {
initial_delay_seconds = 5
period_seconds = 10
failure_threshold = 3
timeout_seconds = 3
}
}

variable "allow_unauthenticated" {
description = "Allow public access to the service"
type = bool
Expand Down
Loading