Given three servers which A , B , C in which A can handle 50% of the traffic , B can handle 30% of the traffic and C can handle 20% of the traffic come up with a formula to distribute load efficiently. The current load of the servers is also an input to the function.
I could not come up with the "formula" he is asking for. Is there any specific answer to this question ?
Least connection load balancing is a dynamic load balancing algorithm where client requests are distributed to the application server with the least number of active connections at the time the client request is received.
Easy to implement and conceptualize, round robin is the most widely deployed load balancing algorithm. Using this method, client requests are routed to available servers on a cyclical basis. Round robin server load balancing works best when servers have roughly identical computing capabilities and storage capacity.
The most common method of a stateless load balancer is by making a hash of the IP address of the client down to a small number. The number is used for the balancer to decide which server to take the request. It also has the ability to pick a server entirely by random, or even go round-robin.
There are a few different ways to distribute load that might be applicable here.
Case 1. Random assignment biased proportionally to each servers load:
for each request
let x = uniformly distributed random number between 0 and 1
if x <= 0.5
goto A
else if x <= 0.8
goto B
else
goto C
Case 2. Round-Robin biased proportionally to each servers load:
let x = new list
push A on x 5 times
push B on x 3 times
push C on x 2 times
for each request
y = pop x
goto y
push y to back of x
Case 3. Forget about the supposed capacity and poll for current load
let La = A, load of A
let Lb = B, load of B
let Lc = C, load of C
goto argmin (La,Lb,Lc)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With