Balancers
Load Balancers reduce the one point of failure problem.
To deal with increased traffic, we can vertically scale our server (add more hardware to our one machine)
we can horizontally scale -> add more machines.
Clients LB Servers
[] ----> [ ]--------> [ ]
[] ----> [ ]--------> [ ]
[] ----> [ ]--------> [ ]
At the DNS level, a strategy called Round Robin is used.
if you run dig google.com
, you get different IP
addresses for google.com.
The same domain name has different IP addresses.
Load Balancing Strategies:
Purely random:
Round Robin:
Weighted Round Robin:
IP based:
Path based:
You may want to mix and match load balancing strategies based on parts of the services. You also need more than one load balancers, to reroute traffic to destinations.
Nginx allows for setting a weight parameter, which lets you route traffic to different servers at different rates..
Prev: [proxies](proxies.html) Next: [hashing](hashing.html)