From 046abdf59b09324b515f653ac6dd107070008428 Mon Sep 17 00:00:00 2001 From: Pyronewbic Date: Wed, 20 May 2026 09:23:06 +0530 Subject: [PATCH] infra: enable CPU throttling, drop API to 1 vCPU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cloud Run was running cpu-throttling: false (CPU always allocated) on all 4 services across 2 regions — paying for idle vCPUs. Enable cpu_idle + startup_cpu_boost on both API and site services. Drop API from 2 vCPU to 1 vCPU (LLM grading is I/O-bound, not CPU-bound). Expected ~60-70% Cloud Run cost reduction. --- terraform/cloud-run.tf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/terraform/cloud-run.tf b/terraform/cloud-run.tf index 51c3f04..6c75e53 100644 --- a/terraform/cloud-run.tf +++ b/terraform/cloud-run.tf @@ -35,9 +35,11 @@ resource "google_cloud_run_v2_service" "api" { resources { limits = { - cpu = "2000m" + cpu = "1000m" memory = "1Gi" } + cpu_idle = true + startup_cpu_boost = true } } } @@ -87,6 +89,8 @@ resource "google_cloud_run_v2_service" "site" { cpu = "1000m" memory = "512Mi" } + cpu_idle = true + startup_cpu_boost = true } } }