mdeuser commented on a change in pull request #3778: Add documentation to the 
loadbalancer.
URL: 
https://github.com/apache/incubator-openwhisk/pull/3778#discussion_r197460019
 
 

 ##########
 File path: 
core/controller/src/main/scala/whisk/core/loadBalancer/ShardingContainerPoolBalancer.scala
 ##########
 @@ -45,10 +45,77 @@ import scala.concurrent.{ExecutionContext, Future, Promise}
 import scala.util.{Failure, Success}
 
 /**
- * A loadbalancer that uses "horizontal" sharding to not collide with fellow 
loadbalancers.
+ * A loadbalancer that schedules workload based on a hashing-algorithm.
+ *
+ * ## Algorithm
+ *
+ * The loadbalancer schedules workload based on a hashing-algorithm. At first, 
for every namespace + action pair a hash
+ * is calculated and then bounded to the number of invokers available. The 
determined index is the so called "home
+ * invoker". This is the invoker where the following progression will 
**always** start. If this invoker is healthy and
+ * if there is capacity on that invoker, the request is scheduled to it. If 
one of these prerequisites is not true,
+ * the index is incremented by a step-size. The step-sizes available are the 
all coprime numbers smaller than the amount
+ * of invokers available (coprime, to minimize collisions while progressing 
through the invokers). The step-size is
+ * picked by the same hash calculated above, bounded to the number of 
step-sizes available. The home-invoker-index is
+ * now incremented by the step-size and the checks (healthy + capacity) are 
done on the invoker we land on now. This
+ * procedure is repeated until all invokers have been checked at which point 
the "overload" strategy will be employed,
+ * which is to choose a healthy invoker randomly.
 
 Review comment:
   when in "overload" mode, it seems the the randomly selected healthy invoker 
should not have capacity - correct?
   
   what does the loadbalancer do when there are currently no healthy invokers 
while in "overload" mode?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to