Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Something I don't understand:

(Tens/hundreds of?) thousands of people simultaneously try to connect to a site like or

From what I understand, they must all necessarily connect to the same initial server (because DNS will return the same IP to many of them, and so all the requests go to the same target destination).

So a single machine/router must handle all the initial requests, even if it plans to forward them to other machines.

How come that single device doesn't get overloaded when this happens?

share|improve this question
Your assumption about DNS is incorrect: – Oliver Salzburg Feb 3 '12 at 20:48
@OliverSalzburg: Thanks for the link, that's helpful. – Mehrdad Feb 3 '12 at 20:52
up vote 20 down vote accepted

Your understanding that they all connect to the same server is wrong, although the details of how you achieve those results are complex. has reference work on how some of the scalability solutions are put into play.

They have well more than just "one" server that clients connect to, even if the public IP address looks the same. Google, for example, make heavy use of anycast addressing to direct people, and usually they don't just have one IP address for each client - even if they return just one address when you ask.

share|improve this answer
+1 thanks for pointing out the error. I can't help but wonder, though: if subsequent requests go to a different server every time, then how does a server continue a different server's session? Or is the randomness on a per-machine/per-session basis? (I would imagine that they all synchronize at the backend, but it would seem very slow to synchronize thousands of servers holding information about millions of users simultaneously.) – Mehrdad Feb 3 '12 at 20:55
The answer is complicated, and depends on the implementation, but one approach is to have a pool of machines that do nothing but send the packets to the right destination without ever actually making a TCP connection. Look to F5, and other load balancer vendors, for the small end of how. Google, I think, use something they built themselves. – Daniel Pittman Feb 3 '12 at 21:00
Cool, thanks for the explanation! – Mehrdad Feb 3 '12 at 21:05
You can also use a split-session methodology. There is a session between the user and the server they're directly connected to, and a "master logical session" between the user and the logical service. If the user moves to a different server, that server just resumes the same master logical session to the logical service. – David Schwartz Feb 3 '12 at 23:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .