AlgoViz

Resource estimation in the real world

medium 28 min

Published figures are anchors for a sanity check, not facts about your system.

Video lesson · Chapter 1 of 6

Convert published totals to average rates

0:00 / 5:38

Sleeps four, they said

1:15Reel coming soon

Theory

Read or listen first. About 2 min.

What it is

An anchor is a real number you can compare an estimate with: how many searches a large engine answers, how many messages a chat carries, what one cache server did in a benchmark, what a machine costs a month.

Anchors come in three qualities. Best is what you measured on your own system. Next is a figure published by the people who run the system or wrote the software, with a date. Last are rules of thumb, which are useful if you call them that.

Why it exists

An estimate without a comparison is hard to judge. If your sum says that a small shop needs more requests a second than the largest search engine, something is wrong.

Anchors also mislead. A benchmark measures tiny values on a quiet machine, a company figure may be ten years old, and some numbers that everyone repeats have no source at all. Part of the skill is to know which is which.

A short history

  1. 1988

    The Transaction Processing Performance Council is founded, so that vendors compare database systems under one set of rules.

  2. 2009

    Facebook engineers describe Haystack, their photo store, with real figures: 60 billion images, 1.5 PB, 550,000 images served per second at peak.

  3. 2013

    Twitter reports an average of about 5,700 posts a second and a record second of 143,199, about 25 times as many.

  4. 2014

    LinkedIn engineers publish a Kafka benchmark with its full setup: two million small records a second on three cheap machines.

  5. 2024

    Netflix reports a peak of 65 million concurrent streams for one live event.

Words to know

Anchor
A known figure used to check an estimate.
Benchmark
A measured result under stated conditions.
Primary source
The people who ran the system or the test.
Hit ratio
Share of reads answered by the cache.
Egress
Data sent out of a cloud, usually paid by the gigabyte.
On-demand price
List price without a commitment.
PoP
Point of presence of a network or CDN.

How it works

Step through the idea, or press Play.

Step 1 of 3

Anchor. A sourced figure with a date

Understand it

Start here

Sleeps four

A tent is sold with a label: sleeps four. It was tested with four people and nothing else. Your trip has rucksacks. Benchmarks are the same: true, under conditions that are not yours.

The label and the trip
SLEEPS 4The label

The label was not a lie. It answered another question.

Why

What real numbers are good for

  • Check an estimate

    Is 100,000 a second realistic for this product?

  • Feel the scale

    Ten thousand and ten million a second are different worlds.

  • Talk with context

    Name the source and the date, then the sum.

  • Choose a technology

    Cache, database or queue: each has a usual range.

How far may I trust a number?

Scale

From a startup to massive

Sizes can be computed from users instead of remembered. Assume 50 requests a user a day, a peak of three times, 10% writes of 1 KB, one copy, text only.

StageDaily usersPeak requestsNew text a yearUsual shape
Startupup to 100,000up to 170/sup to 180 GBone server, one database, a standby
Growing100,000 to 1M170 to 1,700/s0.2 to 1.8 TBa few servers behind a balancer
Medium1M to 10M1,700 to 17,000/s2 to 18 TBcache, read replicas
Large10M to 100M17,000 to 170,000/s18 to 180 TBpartitioned data, CDN, more regions
Massiveover 100Mover 170,000/sover 180 TBspecialised parts for each job
Each row is ten times the last. Around such a step the design changes, not only the number of servers.

One row worked out

10M×5086,400×3≈17,400/s,10M×5×1 KB×365≈18 TB\frac{10\text{M} \times 50}{86{,}400} \times 3 \approx 17{,}400/\text{s}, \qquad 10\text{M} \times 5 \times 1\,\text{KB} \times 365 \approx 18\ \text{TB}
Five writes a user a day is 10% of 50.

Anchors

Published figures, with sources

SystemPublishedPer secondWho and when
Google Searchmore than 5 trillion searches a yearabout 160,000Google, 2025
Google's indexwell over 100,000,000 GB (100 PB)Google, How Search works
WhatsApproughly 100 billion messages a dayabout 1.2 millionFacebook earnings call, Q3 2020
Twitterover 500 million posts a day; record 143,199 in one secondabout 5,700 averageTwitter engineering, 2013
Facebook photos220 million new photos a week; 550,000 images a second served at peakabout 360 new photosFacebook engineering, 2009
Netflix301.63 million memberships; 65 million concurrent streams in one eventNetflix, end of 2024 and November 2024
Wikipedia and sister projects11.56 billion page views by people in October 2026about 4,300Wikimedia public API
Amazon DynamoDBpeak of 146 million requests a second on Prime Day146 millionAWS, 2024
Cloudflare81 million HTTP requests a second on average, 129 million at peak81 millionCloudflare, 2025
Discordtrillions of messages on 177 Cassandra nodesDiscord engineering, about 2022
AWS39 regions, 124 availability zonesAWS, November 2026
The per-second column is our arithmetic. Old figures show their time, not today.

Totals into rates

5×1012365×86,400≈160,000/s100×10986,400≈1.2M/s11.56×10931×86,400≈4,300/s\frac{5 \times 10^{12}}{365 \times 86{,}400} \approx 160{,}000/\text{s} \qquad \frac{100 \times 10^{9}}{86{,}400} \approx 1.2\text{M}/\text{s} \qquad \frac{11.56 \times 10^{9}}{31 \times 86{,}400} \approx 4{,}300/\text{s}
Five trillion a year is 13.7 billion a day, more searches than there are people on Earth. A school that serves 500 lunches a day would need about 75,000 years for that.

Peak against average, measured

  • Cloudflare: 129 / 81 is 1.6 times. Many sites and time zones even each other out.
  • Twitter's record second: 143,199 / 5,700 is 25 times. One television moment, one second.

What that means for you

  • Three times is a starting assumption, not a law.
  • The shorter the window you look at, the higher the peak.

Check

Catch a number that cannot be true

Someone tells you that Netflix streams 15 PB a day. Divide by people.

Per member

15 PB302M members≈50 MB≈80 s of video at 5 Mb/s\frac{15\ \text{PB}}{302\text{M members}} \approx 50\ \text{MB} \approx 80\ \text{s of video at 5 Mb/s}
Nobody pays a monthly fee for 80 seconds a day. With one hour each at 5 Mb/s (2.25 GB) it would be about 680 PB. The figure is far too small, and no primary source supports it, so do not use it.

Sanity check for a company figure

Stores

What one node may carry

Where to start planning

StoreReads a secondWrites a secondTypical latencyUsed for
Redis100,000100,000under 1 mscache, sessions
Memcached100,000100,000under 1 mssimple cache
PostgreSQL10,000 to start, tens of thousands tunedthousands, 10,000 as the line1 to 10 mstransactions, complex queries
MySQLas PostgreSQLas PostgreSQL1 to 10 msweb applications
MongoDBtens of thousandstens of thousands1 to 5 msdocuments
Cassandrathousands to tens of thousandstens of thousands1 to 10 msmany writes, time series
Elasticsearchhundreds to thousandsthousands of documents10 to 100 msfull-text search
Rules of thumb for simple operations on one good machine. Redis documentation shows a benchmark near 180,000 SET operations a second with tiny values. Query shape, record size, indexes and durability move everything else by ten times.

What a cache leaves over

database reads=reads×(1−hit ratio),50,000×(1−0.9)=5,000/s\text{database reads} = \text{reads} \times (1 - \text{hit ratio}), \qquad 50{,}000 \times (1 - 0.9) = 5{,}000/\text{s}
From 95% to 99% sounds like little and cuts the database load by five. From 80% to 95% by four.

50,000 reads a second

Hit ratioReach the databaseShare
0%50,000/s100%
50%25,000/s50%
80%10,000/s20%
95%2,500/s5%
99%500/s1%
And if the cache fails, the database meets all 50,000. See caching.

One or many

When to split a database

One database is fine

  • Under about 10,000 simple reads a second, or a cache takes them
  • Well under 10,000 small writes a second
  • Hundreds of gigabytes, even a few terabytes
  • Hundreds of millions of rows with the right index
  • The hot part fits in memory

Think about splitting

  • Writes near 10,000 a second after batching
  • Size towards 30 TB, or restores that take too long
  • Billions of rows and slow maintenance
  • Replicas and a cache are not enough
  • No larger machine is sensible

Before you split

Machines

Servers and networks

Starting points for one server

RoleSizePlan withDepends on
Web or API server4 vCPU, 8 GB1,000 to 5,000 requests/ssimple reads and writes
Application server8 vCPU, 16 GBhundreds to several thousand/swork per request
WebSocket server8 vCPU, 32 GB50,000 to 100,000 connectionsmessages on them, memory each
Database server16 vCPU, 64 GB, SSD10,000 to 50,000 simple queries/squery shape, hot data in memory
All rules of thumb. A request that uses 5 ms of one core allows 200 a second per core, so 4 cores give at most 800.

Capacity from cost per request

capacity≤coresCPU seconds per request=40.005=800/s\text{capacity} \le \frac{\text{cores}}{\text{CPU seconds per request}} = \frac{4}{0.005} = 800/\text{s}
This replaces a rule of thumb as soon as you can measure one request.

Network

ThingFigureBasis
Server network card10 Gb/s = 1.25 GB/scommon size, arithmetic
TCP connections65,535 ports from one client address to one server address and porta connection is two addresses and two ports
HTTP/2 streams a connectionlimit set by each side; 100 is the smallest recommendedRFC 9113
DNS lookup, not cachedtens to a few hundred msrule of thumb
Same data centreabout 0.5 msrule of thumb
Another zone, same region1 to 2 msrule of thumb
East US to West US69 msMicrosoft, Azure
East US to UK South, West Europe78 ms, 83 msMicrosoft, Azure
East US to Japan East, Southeast Asia162 ms, 224 msMicrosoft, Azure
Round trips. A server can hold far more than 65,535 connections, because many clients connect to it.

Money

What it costs a month

AWS list prices, us-east-1, on demand, 730 hours, November 2026

PartPriceA month
t3.medium, 2 vCPU, 4 GB$0.0416 an hourabout $30
m5.large, 2 vCPU, 8 GB$0.096 an hourabout $70
m5.xlarge, 4 vCPU, 16 GB$0.192 an hourabout $140
RDS PostgreSQL db.m5.large, one zone$0.178 an hourabout $130, disk extra
ElastiCache Redis cache.r5.large$0.216 an hourabout $158
S3 standard, 1 TB$0.023 a GBabout $23, requests extra
Data out to the internet, 1 TB$0.09 a GB at firstabout $90
Application load balancer$0.0225 an hourabout $16, plus usage
Prices change and differ by region. Check the provider's page.

A medium social app, priced

Users reach a load balancer, then 20 application servers at 1,400 dollars a month, which use 3 cache nodes at 474 dollars, 2 database instances at 260 dollars, and object storage of 10 terabytes at 230 dollars. 5 terabytes sent out cost 450 dollars.
20 × 70 + 2 × 130 + 3 × 158 + 10 × 23 + 5 × 90 is about 2,800 dollars a month, plus the balancer. Half of it is servers: check first whether 20 are needed.
Python
PRICE = {"server": 70, "db": 130, "cache": 158, "storage TB": 23, "out TB": 90}app = {"server": 20, "db": 2, "cache": 3, "storage TB": 10, "out TB": 5}for part, n in app.items():    print(f"{part:11} {n:3} x {PRICE[part]:4} = {n * PRICE[part]:5,}")print("total a month:", f"{sum(n * PRICE[p] for p, n in app.items()):,}")
The bill. Try one cache node and ten servers.
Edit and run it in your browser

At a larger scale the order turns round. Assume 15 PB of video a day at 0.02 dollars a GB: 15,000,000 GB × 0.02 is 300,000 dollars a day. At that size a company starts to think about its own content network.

Speak

Using anchors well

Three uses in an answer

  1. Interviewer

    Why do you want a cache?

  2. You

    We have 50,000 reads a second. One relational database is planned with about 10,000. With a 90% hit ratio 5,000 remain, so one database and a replica carry them. Redis documentation shows benchmarks above 100,000 simple commands a second, so one node could do it and I run two so that one can fail.

  3. Interviewer

    A billion users with 10 KB each. Shard?

  4. You

    That is 10 TB, which one large machine holds, though restores take long. If we write 100,000 a second, that decides: I would split by user id, so that one user's reads stay on one shard.

  5. Interviewer

    Is 160,000 searches a second believable?

  6. You

    Google published more than five trillion a year in 2025. That is about 160,000 a second on average, so for the whole world's largest engine, yes. For our shop, no.

Do

  • Say "roughly" and name the source
  • Explain what would change it: hardware, query, size
  • Admit when you do not know: "I think around X"
  • Offer the measurement that would settle it

Avoid

  • Inventing a company's number
  • Quoting ten-year-old figures as today
  • Using a benchmark as your capacity
  • Dropping names instead of arithmetic

From label to plan

Summary

The whole topic in one minute.

Use published figures to check the number of zeros, with their date and source, and never as the capacity of your own system. Turn totals into per second, compare per person, and distrust a figure that fails that check.

Planning starts from rules of thumb: 10,000 simple reads a second for one relational database, 100,000 simple commands for one Redis server, hundreds to a few thousand requests for one application server. Then measure, price the parts, and write down the line at which the design changes.

  • Anchors check zeros, measurements set capacity.
  • Source and date, or call it a rule of thumb.
  • Divide any big total by people and by seconds.
  • Hit ratio from 95% to 99% is five times less load.
  • Price the parts: the largest line is the first to question.

Sources