cbickel commented on a change in pull request #4011: Customize invoker use 
memory for memory based loadbalancing
URL: 
https://github.com/apache/incubator-openwhisk/pull/4011#discussion_r218742733
 
 

 ##########
 File path: 
core/controller/src/main/scala/whisk/core/loadBalancer/ShardingContainerPoolBalancer.scala
 ##########
 @@ -594,22 +599,21 @@ case class ShardingContainerPoolBalancerState(
     val actualSize = newSize max 1 // if a cluster size < 1 is reported, falls 
back to a size of 1 (alone)
     if (_clusterSize != actualSize) {
       _clusterSize = actualSize
-      val newTreshold = if (totalInvokerThreshold / actualSize < 
MemoryLimit.minMemory) {
-        logging.warn(
-          this,
-          s"registered controllers: ${_clusterSize}: the slots per invoker 
fall below the min memory of one action.")(
-          TransactionId.loadbalancer)
-        MemoryLimit.minMemory // letting this fall below minMemory doesn't 
make sense
-      } else {
-        totalInvokerThreshold / actualSize
+      _invokerSlots = _invokerSlots.zipWithIndex.map {
+        case (_, index) =>
+          val memory = _invokers(index).id.userMemory
+          val newTreshold = if (memory / actualSize < 
MemoryLimit.minMemory.toMB.toInt) {
 
 Review comment:
   As this is exactly the same if like in the method above, does it make sense 
to move it to it's own method?
   (They are not completly identical, but I think the log-warning would make 
sense in `updateInvokers` as well.)

----------------------------------------------------------------
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