Skip to content

Optimize Azure and Cosmos hosting costs - #454

Merged
sajeetharan merged 1 commit into
mainfrom
optimize/azure-cosmos-costs
Sep 29, 2026
Merged

sajeetharan merged 1 commit into
mainfrom
optimize/azure-cosmos-costs

Conversation

@sajeetharan

Copy link
Copy Markdown
Owner

Verified findings

  • Cosmos uses manual shared throughput at 4,000 RU/s; average normalized utilization was 14.25% with 100% peaks
  • impact-history contains about 956k documents and 1 GB with no TTL
  • Container Apps averages 6.06% CPU and 29.25% memory with min replicas set to 1
  • ACR Basic, Log Analytics 30-day retention, and Y1 Function plans are already cost-conscious

Changes

  • set Container Apps min replicas to 0 while preserving max replicas at 3
  • add a confirmation-gated, precondition-checked workflow for Cosmos autoscale max 4,000 RU/s and 120-day impact-history TTL
  • reuse one CosmosClient across containers and migrate hot public routes to the shared helper
  • cache country statistics and trending calculations for one hour
  • patch the ip-address production advisory
  • document rollout, tradeoffs, and seven-day follow-up checks

Safety

  • this PR does not execute the one-time Cosmos workflow
  • the workflow refuses unexpected throughput configurations and handles partial autoscale migration reruns
  • search visibility remains uncached

Validation

  • npm test (491 passed, 0 failed, 0 cancelled)
  • npm run build
  • npm audit --omit=dev (0 vulnerabilities)
  • workflow YAML parse checks
  • git diff --check

@sajeetharan
sajeetharan merged commit b63340d into main Sep 29, 2026
3 checks passed
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