A
on System Design: Load Balancer concepts
Topics Covered:
What is a Load Balancer ?
Benefits of a Load Balancer ?
Routing algorithms used in Load Balancing ?
on System Design: Load Balancer conceptsTopics Covered:
What is a Load Balancer ?
Benefits of a Load Balancer ?
Routing algorithms used in Load Balancing ?
What is a load balancer?
Load Balancer is a critical component of any distributed system which sits between a client and a server, accepts incoming requests, and routes them across a a cluster of servers to handle the load.
Load Balancer is a critical component of any distributed system which sits between a client and a server, accepts incoming requests, and routes them across a a cluster of servers to handle the load.
A load balancer keeps track of health status of all the servers connected.
If a particular server is unhealthy, then it will not send incoming requests to that server.
If a particular server is unhealthy, then it will not send incoming requests to that server.
Benefits of a load balancer:
Faster user experience
Less downtime and high throughput. If a particular server is down, LB takes care of routing the traffic to the ones which are up.
Faster user experience
Less downtime and high throughput. If a particular server is down, LB takes care of routing the traffic to the ones which are up.
Reduces individual server load and prevents any one application server from becoming a single point of failure.
Improves response time
Improves overall system availability
Routing algorithms used:
A load balancer can use any of the below algorithms to decide where to route the next incoming request.
The algorithm used depends on the use case:
A load balancer can use any of the below algorithms to decide where to route the next incoming request.
The algorithm used depends on the use case:
Least Connection Method: Route traffic to the server with the fewest active connections.
Least Response Time Method: Route traffic to the server with the fewest active connections and the lowest average response time.
Least Bandwidth Method: Route traffic to the server that is currently serving the least amount of traffic measured in megabits per second (Mbps).
Round Robin: Routes through a list of servers and sends each new request to the next server. When it reaches the end of the list, it starts over at the beginning.
Weighted Round Robin Method: The weighted round-robin scheduling is designed to better handle servers with different processing capacities. Each server is assigned a weight (an integer value that indicates the processing capacity)
Servers with higher weights receive new connections before those with less weights and servers with higher weights get more connections than those with less weights.
IP Hash:
Under this method, a hash of the IP address of the client is calculated to redirect the request.
IP Hash: Under this method, a hash of the IP address of the client is calculated to redirect the request.
I hope this can serve as a goto thread for learning Load Balancer concepts.
Let me know your thoughts in comments
Let me know your thoughts in comments
Read on Twitter