Load balancing

Load balancers

  • Routinely check the health of components
  • Distribute heavy traffic load across the components (like servers) running in the cluster
  • Reduce the risk of high load on a few machines
  • Act as a single point of contact to clients

They can be used to manage traffic directed towards any component.

In-service instances: Instances (like servers) that are up and running in the cluster
Out-of-service instances: Instances that are down

Load Balancing methods

  • DNS Load Balancing
  • Hardware-based Load Balancing
    • Network switches and routers - Cisco Catalyst, Barracuda load balancer
  • Software-based Load Balancing
    • Work on scheduling algorithms - HAProxy, NGINX

Algorithms used in Load Balancing

  • Round Robin/Weighted Round Robin: Routed sequentially to servers.
  • Least connections: Routed to servers with the least open connections.
  • Random
  • Hash: Routes to a specific server based on source IP Hash.
    • A client will always connect to the same server.
    • Can provided efficient ways to implement caching.