Problems / Cloud and cost, medium

The spike beats the alarm

A web fleet runs on 2 EC2 instances in an Auto Scaling group that tracks 50% CPU. At 2 minutes a TV ad triples traffic for 10 minutes. Target tracking needs 3 one-minute periods above target, then each new instance takes about 3 minutes to boot and pass health checks.

Unlock it once for 15 credits; everything inside it is free (runs, changes, Submit, results, hints). Sign in with Google to start; new accounts get free credits.

Your goals

Keep success at 99% or more through the ad.

Test cases

Like a coding problem, a solution has to pass every case, not just the one it was built for. Submit in the lab runs all 3; 1 of them are hidden until then.

  1. As given. The problem’s own traffic, scheduled failures and seed.
  2. A slow dependency. The main data store or model answers twice as slowly for part of the run.

The traffic

75 requests a second for 900 seconds: 100% web (reads).

The system

What each component does in this design, and what calls it. The simulator mimics each one from these settings.

ComponentIts job hereSettings
Application Load BalancerLoad balancerTraffic enters here.Calls Web fleet (EC2 Auto Scaling).Layer 4 balancers route by IP and port; layer 7 balancers read HTTP and can route by path or header.–
Web fleet (EC2 Auto Scaling)Autoscaling groupApplication Load Balancer forwards to it.Calls Aurora Postgres.Autoscalers add instances when a metric stays high, but new instances take minutes to be ready.200 slots · 2–12 instances
Aurora PostgresSQL databaseWeb fleet (EC2 Auto Scaling) calls it.Postgres runs one process per connection, which is why poolers like PgBouncer sit in front of busy databases.16 vCPU · 300 connections

More cloud and cost problems