Load Balancers
A load balancer behaves exactly as advertised: it balances a load of network traffic across some number of servers.
Think of a huge website like Google. There’s no way that a single server (literally a single physical computer) could handle all of the searches for the entire world. A central server, called the “load balancer”, receives traffic from users (clients), then routes those requests to different back-end application servers.
A good load balancer sends new traffic to servers that have lower current resource utilization (CPU and memory). The goal is to “balance the load” so that no single backend server becomes overwhelmed.
Round-Robin Strategy
There are many strategies that load balancers use to determine where to send traffic. A very simple and common strategy is “round robin”, where requests are simply routed one after the other to different back-end servers in a cycle:
- Request 1 -> Server 1
- Request 2 -> Server 2
- Request 3 -> Server 3
- Request 4 -> Server 1
- Request 5 -> Server 2
- …