Grokking the System Design Interview
Vote

0% completed

Load Balancing Algorithms

A load balancing algorithm is a method used by a load balancer to distribute incoming traffic and requests among multiple servers or resources. The primary purpose of a load balancing algorithm is to ensure efficient utilization of available resources, improve overall system performance, and maintain high availability and reliability.

Load balancing algorithms help to prevent any single server or resource from becoming overwhelmed, which could lead to performance degradation or failure

.....

.....

.....

Like the course? Get enrolled and start learning!
R

ruthvicsai.s

· 2 months ago

How does Least Connections perform well in heterogeneous envs?

If server A and B can handle max 10 connections, while C can handle 5. Least connections does not know this, and can overload C since it has the lowest active connections.

Weighted least connections fixes this issue and could be good in these situations, however I do not see least connections performing well.

Is there an angle I am missing?

Show 1 reply
Piyush Kuhikar

Piyush Kuhikar

· 2 months ago

what does capacity mean in weighted round robin?

"Capacity” usually means how much traffic that backend can handle relative to others, which can be based on different limiting resources, such as:

  • network bandwidth (link speed / expected throughput),
  • CPU and request processing capacity,
  • memory / concurrency limits,
  • observed performance (latency/throughput under load),
  • hardware specs or SLA targets.
Show 1 reply
Piyush Kuhikar

Piyush Kuhikar

· 2 months ago

I was confused between Least Bandwidth and Least Connections LB. Had to look over the internet. Here's what I found: In a Least Bandwidth load balancer, the balancer tries to send each new request to the backend that has the most available network capacity (equivalently, the backend with the lowest current bandwidth usage / lowest estimated load in terms of bytes-in/bytes-out). Practically, it means it’s tracking traffic rate (throughput), not just how many requests are happening.

Least Connections instead routes to the backend with the fewest active/ongoing connections (or least inflight requests). It’s tracking count of concurrent sessions, not how much data each session is moving.

Show 1 reply
Sajid Khan

Sajid Khan

· 3 months ago

I'm still fairly new to system design, so I spent quite a bit of time on this page because I prefer to fully understand a concept before moving on. While going through it, I was also doing some parallel research to validate my understanding.

From what I've read, Least Connections alone may not be sufficient in a heterogeneous environment because it doesn't take server capacity into account. A less powerful server and a high-capacity server could end up receiving a similar number of connections, which may lead to an uneven load distribution.

Because of that, I think this advantage should be attributed specifically to Weighted Least Connections rather than Least Connections in general, since the weighted variant considers the relative capacity of each server.

Please let me kno

Show 1 reply
anubhav

anubhav

· 3 months ago

IN  Least Response Time you said request to be routed to LB with least average response time. I think Average is not a good metric when it comes to response time as a single request suppose requesting for heavy data from backend will shoot up the average response time fast. It is suspectible to outliers instead better metric is median like p50 or p90 or p99 etc. They will give how many users request are fast and who are slowest (p99) generally users which are most critical since they have the most data. Median seems to be better metric

Show 1 reply
SOHEL RANA

SOHEL RANA

· 4 months ago

I think if LB algos is used as per requests not connection then only IP Hash algo could be used for stateful web application. Here context is Least connection and Least bandwidth algo are used as per connection which is why it does get used in stateful scenario.

But if this is the case then other algo, least response, round robin can also be used. can anyone please clarify on this?

Show 1 reply
R

rvigneshramanujam

· 9 months ago

In case of a Microservice application , where the servers are added and removed dynamically and are short lived , which type of Load Balancer algorithm s used

Show 2 replies
Sid D

Sid D

· a year ago

CDN's don't specifically have any high bandwidth demands. Its more application specific. So what makes LBW approach specifically useful for CDN use case? Can you expand further on this?

Show 1 reply
Sid D

Sid D

· a year ago

An IP can map to any server from the pool. Its not possible that an IP from a specific region maps to a specific server that is geographically close to it. Then why is it mentioned that IP hash LB is useful in geographically distributed clients?

Show 5 replies
Aldemar Hernández

Aldemar Hernández

· 2 years ago

Why one of the use cases for least connections algorithm is stateful applications if information that must be maintained is active connections to each server and not session state.

Show 4 replies

Reading Progress

0%


Vote for new content