Search code examples
network-programmingdnsload-balancingtopology

Load balancing topology


I'm trying to understand how load balancer works. I understand the idea that load balancer works as a facade for lots of computers from outer world. But I do not understand details.

Take a look at the picture that I draw: enter image description here

How I understand load balancing process:

  1. User enters address abc.xyz.com in his browser
  2. DNS server returns load balancer IP (129.1.1.1) using abc.xyz.com as a key
  3. Browser establishes connection with load balancer using it IP 129.1.1.1
  4. Load balancer (using his internal algorithm) returns to browser Machine 2 IP (2.2.2.2)
  5. Now browser works with machine 2.2.2.2 without any load balancer

If it's true, then I have a question: Why load balancer does not die if 10 000 000 users will connect to abc.xyz.com at the same time?

My idea: in reality system has lots of load balancer and each person routed to "his" load balancer. If it true than who balancing load balancers?

Additional questions:

  1. Does load balancer just a regular computer with OS or it's some kind of special-oriented hardware?
  2. In some resources I found information that load balancer is a software on virtual server. Not sure that I understand what does it mean.

Solution

  • There is multiple types of load balancing :

    These 2 are the most used, but there is also other kinds

    • Dns load balancing (there are many ip behind www.google.com). DNS reply with differents outputs
    • IP load balancing. Where you are wrong is that in most case the traffic continue to pass via the load balancer. The load balancer is acting like a NAT router, modifying destination/ip. The client has no idea of the existence of 2.2.2.2 in your example (which may be a private IP outside of the client ip range)

    Why load balancing appliance are not overwhelmed is due to the fact that packets are not deeply inspected. It's like your postman, which is carrying far more letters than he is actually able to read.

    Load balancer can be a software installed on a specific OS, a specific virtual server (which is a pre-configurer OS with pre-installed software), a dedicated appliance which specific hardware... It only depend of the performance you are waiting for.

    Sometime, load balancer also include heavy process (for example SSL offloading) but this is performed with dedicated hardware.