0

I know how to setup these solutions:

  1. Let's say the website www.example.com has a single machine for it (IP 203.0.113.123), using a Linux + Apache server. It works if the bandwidth is not too high.

  2. Let's say we now have more and more requests for this website, thus the computer with IP 203.0.113.123 will now only be a load-balancing server, dispatching the requests to many workers (other computers), which serve the actual webpages.

but I have a question about this case:

  1. Let's say now there are sometimes peaks of tens or hundreds of thousands of requests per second for this website. Having a single load-balancing machine 203.0.113.123 is not possible anymore.

If we have 10 load-balancing machines: 203.0.113.123, 203.0.113.124, 203.0.113.125, 203.0.113.126, 203.0.113.127, ..., 203.0.113.132 (that dispatch the requests to tens of other workers), how to have the clients arrive to all of them, randomly / Round-robin-style?

The DNS records usually display only one A record, even for big well-known websites (see here the DNS records for Google, there is only one A record), such as:

www.example.com 3600    A   0   203.0.113.123

How to make that clients' requests arrive to the ten machines randomly and not only 203.0.113.123?

(Obviously, we don't want a single machine to dispatch the requests to the ten load-balancing machines, because then we would be back to case 2.)

Basj
  • 709
  • 3
  • 11
  • 29
  • There can be multiple A records for the same hostname. Try `dig stackoverflow.com ` or `nslookup stackoverflow.com`. https://en.wikipedia.org/wiki/Round-robin_DNS – Dusan Bajic Dec 15 '19 at 15:10
  • @DusanBajic I tried for google.com, and there is only one A record. Also, even if there are multiple A records, how are they chosen? Won't most clients use the first one? – Basj Dec 15 '19 at 15:12
  • @DusanBajic Indeed `nslookup stackoverflow.com` shows four IP addresses. Do you think 4 load-balancing servers are enough for such a big website? (well in fact, it might not be so surprising, since the bandwidth is not so high, in comparison to video-sharing websites, etc.). Note: `nslookup youtube.com` shows only one IP. So there is surely an internal mechanism to distribute the requests to many load-balancing servers, what is it? – Basj Dec 15 '19 at 15:15
  • For really huge sites, it is either geodns (see https://www.whatsmydns.net/#A/youtube.com) (https://en.wikipedia.org/wiki/GeoDNS, https://jameshfisher.com/2017/02/08/how-does-geodns-work/) or BGP anycast (https://serverius.net/bgp-anycast-dual-datacenter-using-1-ip-multiple-locations/, https://www.keycdn.com/support/anycast) – Dusan Bajic Dec 15 '19 at 15:21
  • And for "Won't most clients use the first one", the answer is :"With each DNS response, the IP address sequence in the list is permuted." – Dusan Bajic Dec 15 '19 at 15:26

0 Answers0