rabbah commented on a change in pull request #2360: Choose target invoker based 
on specific invoker load.
URL: 
https://github.com/apache/incubator-openwhisk/pull/2360#discussion_r122567875
 
 

 ##########
 File path: 
core/controller/src/main/scala/whisk/core/loadBalancer/LoadBalancerService.scala
 ##########
 @@ -277,14 +277,44 @@ class LoadBalancerService(config: WhiskConfig, 
entityStore: EntityStore)(implici
             case _              => false
         }
         val invokers = if (isBlackbox) blackboxInvokers else managedInvokers
-        val (hash, count) = hashAndCountSubjectAction(msg)
+        val hash = hashSubjectAction(msg).abs
 
         invokers.flatMap { invokers =>
             val numInvokers = invokers.length
             if (numInvokers > 0) {
-                val hashCount = math.abs(hash + count / 
activationCountBeforeNextInvoker)
-                val invokerIndex = hashCount % numInvokers
-                Future.successful(invokers(invokerIndex))
+                val nextInvokerThreshold = 
config.loadbalancerInvokerBusyThreshold
+                val homeInvoker = hash % numInvokers
+
+                val stepSizes = coprimePrimeNumbersUntil(numInvokers)
+                val step = stepSizes(hash % stepSizes.size)
+
+                /*
+                 * Scans through all invokers and searches for an invoker, 
which's queue is below
 
 Review comment:
   searches for an invoker, which's queue is -> searches for an invoker with a 
queue is 
 
----------------------------------------------------------------
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