Skip to content
System design · Staff · 14 min

Plan capacity for a ticket sale where 600,000 buyers arrive in a minute

Work back from the database's write limit to an admission rate, then size the edge, the app tier and the connection pool around it.

Prompt

A ticketing site idles at 500 requests/s. At 10:00 a sale opens and 600,000 buyers arrive within 60 seconds for 60,000 tickets. The database can sustain 2,500 writes/s and accepts 500 connections. Plan the capacity of each tier, design the waiting room that protects the database, say what you scale before the sale and what you leave to autoscaling, and describe the load test that would prove it.

Questions worth clarifying

  • Selling a seat twice is unacceptable; making people wait is acceptable
  • The sale time is known days in advance
  • A new instance takes about 3 minutes to start serving traffic
  • About 2 tickets per order: stock is gone after roughly 30,000 orders
  • Waiting buyers see their place in line and an honest estimate

Inputs you will estimate from

Buyers arrivingArrival windowQueue poll intervalBuyers admitted/sRequests per buyerRequests/s per app instanceWrites per buyerDatabase write limitConnections per instanceDatabase connection limit
Open to everyone until Pro goes on sale · sign in to save your attemptOpen the workbench with live capacity math
Open in the app