Back to blog

Can you size your servers on the back of a napkin?

Thắng Đoàn
Thắng Đoàn

FotoFlow is still one server, but you are planning for real growth and must decide: one machine or a hundred? You do not need exact numbers, just the right order of magnitude, and napkin math gets you there in minutes before any technology is chosen.

From users to requests per second

Start from what you know: people and their habits. Suppose the dream scenario, 10 million users who each make about 20 requests a day. That is 200 million requests daily.

A day has 86,400 seconds. Round it to 100,000, because napkin math is about being quick, not precise. 1 million requests per day is roughly 12 requests per second. Memorize that one shortcut and most estimates fall out of it.

Size for the peak, not the average

Traffic is not flat. People browse in the evening and during events. A typical peak is 2 to 3 times the daily average. A system sized for its average load is down at exactly the moment most people use it. So multiply by 3: your 10 million users land around 2,400 requests per second at peak, and the lone server is clearly outclassed.

Servers, storage, network, memory

Servers: a load test shows one FotoFlow server handles about 1,000 requests per second, measured rather than guessed. Peak needs 7, plus headroom for spikes and for one machine dying. Call it 10.

Storage: photos are the big one. 1 million uploads a day at 2 MB each is 2 TB daily, about 730 TB a year. Data is usually stored three times so a dead disk loses nothing, so plan roughly 2 PB in year one. Storage grows every day and never resets. Requests come and go; bytes stay. That single line already rules out one database server.

Network: uploads are the small part, about 20 MB per second coming in. Viewing is the monster. If each user looks at 100 photos a day as 200 KB thumbnails, that is 200 TB a day going out, about 2 GB per second. Read-heavy media apps are limited by bandwidth before CPU, and that is a job for a CDN, not ten web servers.

Memory: feeds constantly read photo metadata and profiles. Could a cache hold the hot part? Ten million profiles at 2 KB is 20 GB, and today's new photos are another 1 GB. About 21 GB fits in the memory of one cache server, plus a second for redundancy. Napkin math often tells you something is smaller than you think, and that is just as valuable as finding something big.

Numbers worth memorizing

Five anchors make most estimates possible: reading from memory is about 100 nanoseconds, reading from SSD about 100 microseconds, a round trip inside one data center about half a millisecond, a round trip across an ocean 75 to 150 ms, and a day is roughly 100,000 seconds. Learn the orders of magnitude, not the decimals.

What this does not solve

A napkin answer is a guess with the right shape, not a capacity plan. It cannot tell you your real per-server throughput, only a load test can, and it says nothing about how to actually split traffic across those 10 servers. That is the next post.

If you estimated your own project's storage for one year, would the number surprise you in either direction?
Which is the real ceiling for your app today: CPU, storage, or bytes leaving the door?

Rough numbers first. Precision after the design exists.

Next in the series: Bigger server or more servers: which fix buys you time?

Sources

System Design Primer

Google SRE Books

undefined

Designing Data-Intensive Applications

Share:

Recommended for you

Enjoyed this article?

Subscribe for new articles. No spam. Unsubscribe anytime.

No pasting. This is the challenge.0/200

Typed live, never pasted.