AlgoViz

Resource estimation in the real world

medium 28 min

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

See it run

Published figures as anchors, a claim that fails, and the numbers you must measure yourself.

Operations

Totals into rates

Published totals, turned into requests a second, smallest first.

Step 1 of 6

A large site

SystemPublishedPer second, average
Wikipedia family11.56B views in Oct 20264,300
Twitter, 2013
Google Search, 2025
WhatsApp, 2020
Cloudflare, 2025
Your shop

Wikipedia and its sister projects: 11.56 billion page views by people in a month, about 4,300 a second.

Step 1: A large site

def per_second(total, seconds):    return total / secondsgoogle   = per_second(5 * 10**12, 365 * 86_400)whatsapp = per_second(100 * 10**9, 86_400)shop     = per_second(2_000_000, 86_400)
When
Checking zeros
You leave with
A feeling for scale

Say the year. A 2013 figure describes 2013.

In the real world

The same resource estimation in the real world doing real jobs. Pick one and step through it.

50 requests a user a day, three times at peak. Every step of ten changes the shape.

Step 1 of 5

Startup

StageDaily usersPeak requestsShape
Startup100,000170/sone server
Growing
Medium
Large
Massive

100,000 users: 170 requests a second at peak.

Step 1: Startup

Common mistakes

The bugs interviewers watch for, with the fix beside each.

  • A benchmark as capacity

    critical

    It was measured with tiny values on a quiet machine. Yours is neither.

    Wrong
    nodes = load / 180_000
    Right
    nodes = ceil(load / (our_test * 0.7)) + 1
  • Numbers without a source

    major

    A figure that everybody repeats may be invented or ten years old.

    Wrong
    NETFLIX_PB_PER_DAY = 15
    Right
    # no primary source: leave it out
  • Splitting at a round number

    major

    1 TB or a billion rows alone is no reason. Writes, restore time and cost are.

    Wrong
    if size_tb > 1: shard()
    Right
    if writes > line or restore_h > limit:    plan_split()
  • Forgetting the empty cache

    critical

    After a restart every read goes to a database sized for one in twenty.

    Wrong
    db = reads * 0.05
    Right
    db = reads * 0.05assert survives(empty_cache)

Interview tips

  • How to explain it

    • Anchors check zeros.
    • Measurements set capacity.
    • Prices show what to question.
  • Memory trick: the tent

    • Sleeps four, with no bags.
    • Test it with your bags.
    • Then bring enough tents.
  • Rules of thumb

    • Redis 100,000, relational 10,000.
    • Web server 1,000 to 5,000.
    • WebSocket server 50,000 to 100,000 connections.
  • Be honest

    • Say "roughly" and the year.
    • Say where it comes from.
    • Say what would prove you wrong.