Understanding load

Topic 1 of 8 in Week 2: Scaling, traffic and estimation9 min readBeginnerFree course

Overview

“It needs to scale” means nothing until you say how much load. Is it 10 requests a second or 100,000? Mostly reads or mostly writes? Small JSON or 4K video? This lesson gives you the measures that describe load, so the rest of your design has a target.

The core numbers

From users to requests per second in four steps: 50 million daily active users; times 20 requests each gives 1 billion requests per day; divided by 86,400 seconds gives about 12 thousand average queries per second; peak is about 3 times the average, around 35 thousand. Below, a read/write ratio bar: reads are about 95 percent (feed, profile, search) and writes about 5 percent. Read-heavy systems need caches and read replicas; write-heavy systems need queues, batching and sharding. Design for the peak, keep headroom, and also ask about request sizes and spikes.

Users

  • DAU (daily active users) and MAU (monthly active users) describe the size of the audience.
  • Concurrent users matter for systems with persistent connections, such as chat or games.

User counts are a starting point, not the answer. A user of a banking app might make 5 requests a day; a user of a social feed might make 200.

Requests per second

Convert users into QPS (queries per second) or RPS (requests per second):

Text
requests per day = DAU × requests per user per day
average QPS      = requests per day ÷ 86,400

A day has 86,400 seconds; rounding to 100,000 (10⁵) is fine for estimates. So 1 million requests per day is about 12 per second, and 1 billion per day is about 12,000 per second. Memorise those two.

Peak vs average

Traffic is never flat. People use apps in the evening, shops get hammered on sale days, and sports sites spike during matches. A common assumption is peak = 2–3× average for everyday traffic, but special events can reach 10× or more.

Design for the peak plus some headroom. A system that copes with the average falls over at exactly the moment the most users are watching.

Read/write ratio

Split traffic into reads (fetching data) and writes (creating or changing data):

  • Read-heavy systems (social feeds, news, product catalogues) often see 10:1 to 1,000:1. They benefit most from caches, CDNs and read replicas.
  • Write-heavy systems (logging, metrics, IoT sensors, chat) need fast write paths: append-only storage, queues, batching and sharding.

The ratio is one of the most useful numbers in an interview because it points directly at the right tools.

Size of data

Count bytes as well as requests:

  • Request and response size: a 1 KB JSON response at 10,000 QPS is 10 MB/s; a 2 MB image at the same rate is 20 GB/s and changes the design completely.
  • Data growth: new data per day, and how long you keep it.
  • Working set: the part of the data that’s accessed often; if it fits in memory, life is much easier.

The shape of traffic

Beyond averages and peaks, ask how traffic behaves:

  • Daily and weekly cycles: predictable, so autoscaling can follow them.
  • Spikes: a flash sale, a viral post or a push notification sent to millions at once. These arrive in seconds, faster than new servers can start, so you need headroom, queues or rate limits.
  • Hot keys: a celebrity’s profile or a trending product gets a huge share of reads. Load is uneven even when the total is fine.
  • Geography: global users bring traffic around the clock and make distance a factor.

Which kind of load is it?

Different workloads stress different resources:

Workload Example Usually limited by
Many small reads Product pages Database reads, cache hit rate
Many small writes Likes, metrics Write throughput, contention on hot rows
Large transfers Video, backups Bandwidth, storage
Heavy computation Search ranking, encoding CPU
Long-lived connections Chat, live updates Memory and connections per server

Load in an interview

Spend a minute pinning load down during requirements:

  • “How many daily active users, and how many actions does each do per day?”
  • “Is it read-heavy? Roughly what ratio?”
  • “Are there predictable peaks or big events?”
  • “How big are the objects: text, images, video?”

If the interviewer says “you decide”, pick round, reasonable numbers, write them on the board and move on. Then use them: “with 35,000 reads per second at peak, a single database won’t keep up, so I’ll put a cache in front of it”.

Recap

Load is described by users, requests per second (average and peak), the read/write ratio and the size of data. One million requests a day is about 12 per second; design for the peak, not the average. The ratio and the data size tell you which tools you’ll need, and the shape of the traffic tells you how much headroom to keep.

Exercise

Describe the load

A food-delivery app has 8 million daily active users. On average each user opens the app 3 times a day and each session makes 15 API reads (menus, restaurant lists, order status). About 10% of users place an order each day, and an order involves 5 writes. Most traffic happens at lunch and dinner. Estimate (a) reads per day and average read QPS, (b) writes per day and average write QPS, (c) the read/write ratio, (d) a sensible peak QPS to design for, and say what the ratio suggests about the design.

Text
(a) Reads:
(b) Writes:
(c) Ratio:
(d) Peak:

What it suggests:

Summary

  • Load is described with numbers: daily active users, requests per second (average and peak), read/write ratio and data size.
  • Average QPS = requests per day ÷ 86,400; a day has about 10⁵ seconds.
  • Design for the peak, which is often 2–5× the average and much higher during events.
  • The read/write ratio decides the toolkit: caches and replicas for reads, queues and sharding for writes.
  • Also capture request and response sizes, data growth and how spiky the traffic is.