KeonHee commented on a change in pull request #4477: Limit the minimum to the 
cpu-share value
URL: 
https://github.com/apache/incubator-openwhisk/pull/4477#discussion_r283191863
 
 

 ##########
 File path: 
common/scala/src/main/scala/org/apache/openwhisk/core/containerpool/ContainerFactory.scala
 ##########
 @@ -44,7 +44,10 @@ case class ContainerPoolConfig(userMemory: ByteSize, 
concurrentPeekFactor: Doubl
    */
   private val totalShare = 1024.0 // This is a pre-defined value coming from 
docker and not our hard-coded value.
   // Grant more CPU to a container if it allocates more memory.
-  def cpuShare(reservedMemory: ByteSize) = (totalShare / (userMemory.toBytes / 
reservedMemory.toBytes)).toInt
+  def cpuShare(reservedMemory: ByteSize) = {
+    val cpuShare = (totalShare / (userMemory.toBytes / 
reservedMemory.toBytes)).toInt
 
 Review comment:
   @style95 Thanks for your review. I think that's better!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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