You are signed in. Close

You are signed out. Close

Thank you. Your subscription has started. Close

Thank you. You will get an email when a new comic comes out. Close

We could not confirm your payment. If you paid, use the link "Sign in" at the bottom of the page. Close

Something went wrong on our side. Please try again in a moment. Close

What happens when a website goes viral: how a site keeps up with millions of visitors

Server capacity: why a website slows down for everyone at once

A website works fine for a hundred visitors. Then a big crowd arrives at once, and the website stops answering. It does not fail only for the last visitors. It fails for everyone.

  1. 1 You made a small website with a new word puzzle every day, the same word for every player. At 9:00, Miva and a few others open it, and your server, the computer that sends them the puzzle, has almost nothing to do.9:00your serverMiva

    You made a small website with a new word puzzle every day, the same word for every player. At 9:00, Miva and a few others open it, and your server, the computer that sends them the puzzle, has almost nothing to do.

  2. 2 At 9:01, Rono, a singer with millions of followers, posts his score and the link. It does not stay a small website for long.9:01RonoToday's wordin 3 tries!puzzle.example

    At 9:01, Rono, a singer with millions of followers, posts his score and the link. It does not stay a small website for long.

  3. 3 By 9:05, two million people want today's puzzle. Each tap sends a request, a short message that asks your server for the page, and each request costs the server a little work.9:05your server2,000,000 players

    By 9:05, two million people want today's puzzle. Each tap sends a request, a short message that asks your server for the page, and each request costs the server a little work.

  4. 4 Your server can work on only so many requests at the same time: that is its capacity. The others wait in a line, and at 9:05 the line grows much faster than the server can empty it.your serverfullwaiting

    Your server can work on only so many requests at the same time: that is its capacity. The others wait in a line, and at 9:05 the line grows much faster than the server can empty it.

  5. 5 A new request joins the back of the line and waits for every request in front of it. So the wait grows for everyone who taps, even early players sending their next guess. Past a certain wait, the request is dropped: a timeout.the backthe front30 stimeout

    A new request joins the back of the line and waits for every request in front of it. So the wait grows for everyone who taps, even early players sending their next guess. Past a certain wait, the request is dropped: a timeout.

  6. 6 Worse, the server keeps working on requests whose players already gave up. Even Miva, who came at 9:00, sends her next guess and sees nothing load. Too many requests did not just slow the site down for some players: they stopped it for all of them.Mivaplayer gone

    Worse, the server keeps working on requests whose players already gave up. Even Miva, who came at 9:00, sends her next guess and sees nothing load. Too many requests did not just slow the site down for some players: they stopped it for all of them.

  7. 7 Miva sends you a fix that sounds obvious.MivaJust get abigger server!

    Miva sends you a fix that sounds obvious.

  8. Quick check

    A bakery can serve 60 customers an hour. On a holiday morning, 80 an hour walk in, hour after hour.Does the linestay the same,or grow?

    A bakery can serve 60 customers an hour. On a holiday morning, 80 an hour walk in, hour after hour.

    Show the answer

    It grows. Each hour, 20 more people come in than the bakery serves, so each new customer waits longer than the one before.

  9. Go further

    The morning, with the names people use.hug of deathwhat people call asmall website takendown by a link on abig one30 slatencyhow long a requestwaits for its answer:it grew for everyonethroughputhow many requestsa server finishes eachsecond: its capacitysets the top

    The morning, with the names people use.

Next episode Load balancers: why many small servers beat one big one

Share this comic

More comics