You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/06/17 13:10:40 UTC
[GitHub] rabbah commented on a change in pull request #2360: Choose target invoker based on specific invoker load.
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:
users@infra.apache.org
With regards,
Apache Git Services