How to allocate operations to balance the load on the servers?

33 Views Asked by At

We have 1000 operations to process.

We have 3 servers: S1 can process 13 operations per second S2 can process 29 operations per second S3 can process 59 operations per second

How shall we allocate the operations for load balancing?

What if each operations takes a different amount of time?

I was thinking to use something related to little's law, but I am not sure how to tackle the problem.

1

There are 1 best solutions below

0
On BEST ANSWER

In total, you can process $13+29+59=101$ operations per second. Thus you could process $1010$ operations in $10$ seconds by giving $130$, $290$, and $590$ operations to the servers. Now where to take the extra $10$ operations from? It depends. It is compatible with the problem statement that processing less that $13/29/59$ operations still takes one second. In that case it does not matter. However, if we assume that the execution time is exactly proportional to the number of operations, just greedily remove one task from the slowest server that finishes its last task at the total finishing time. So first we remove from $S_1$, then from $S_2$, then from $S_3$, then again from $S_3$, again $S_3$, then from $S_2$, $S_3$, $S_3$, $S_2$, $S_1$. we end up with $128$, $287$, $585$ operations for the individual servers and a total running time of $\max\{\frac{128}{13},\frac{287}{29},\frac{585}{59}\}=\frac{585}{59}\approx 9.92$ seconds.