An ML service has 100 million daily active users, and each user triggers 20 model requests per day. Peak traffic is 3× the daily average, and one server handles 500 QPS (queries per second) within the latency target. What are the average QPS, peak QPS, minimum servers needed, and servers needed with 30% headroom? Why do you size for peak rather than average?

ML system design, Estimation
Level L2 Elementary. Length Short. Nature Mat Mathematical.

What's being asked

Whether you can convert daily user counts into serving capacity cleanly and know why systems must be sized for traffic peaks.

Key idea

Multiply DAU (daily active users) by requests per user and divide by 86,400 seconds per day to get average QPS, then multiply by the peak factor and headroom before dividing by per-server capacity. Sizing for the daily average fails during busy hours when queues build up and latency spikes.

Steps

  1. Total daily requests: 100×106 users×20 requests/user=2×109 requests per day.
  2. Average QPS: divide by 86,400 seconds in a day (24×60×60), giving QPSavg=2×10986,400≈23,148 QPS.
  3. Peak QPS: multiply by the peak factor of 3, giving QPSpeak=3×2×10986,400≈69,444 QPS.
  4. Servers needed: at 500 QPS per server, peak traffic requires 69,444500≈138.89, or 139 servers at the bare minimum. Adding 30% headroom (138.89×1.3≈180.56) gives 181 servers. (Some teams define headroom as a target utilisation instead, for example 70%, which would give 138.89/0.7≈198.4, so 199 servers; state which convention you use.)
  5. Why plan for peak, not average: user traffic clusters into evening or workday peaks, and queueing latency grows steeply as server utilisation approaches 100%. Sizing for peak with headroom absorbs bursts, node failures and rolling deploys without breaching latency targets.

Common mistakes

How long your answer should be

Four lines of arithmetic and two sentences on peak headroom; about 2 minutes.

Read this

Previous in ML system design: Why do we sometimes train one model on several GPUs at once, and what is the simplest way to share the work between them?
Next in ML system design: When should you choose batch (offline, precomputed) inference over online (real-time) inference, and how do hybrid designs combine the two?