You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by 甯尤刚 <ni...@navercorp.com> on 2020/04/28 00:32:08 UTC

Adjust prewarm container dynamically

Hi, guys.
​
     I wrote a pr here(Adjust prewarm container dynamically): https://github.com/apache/openwhisk/pull/4058
     This feature is disabled by default. if want to use it, can add some extra configuration in runtimes.json as below
​
    "stemCells": [
         {
           "initialCount": 2,   //filedName is changed from count to initialCount
            "memory": "256 MB",
            "reactive": {        
                  "minCount": 1,
                  "maxCount": 4,
                  "ttl": "2 minutes",
                  "threshold": 1,
                  "increment": 1
                 }
          }
       ]
​
initialCount means create init containers when invoker starts
reactive is optional(disabled by default), have several sub configuration
1. minCount: if some prewarmed containers are deleted due to unused, need to keep minCount containers not to be deleted.
2. maxCount:  can't create more containers more than maxCount.
3. ttl: if the container is not used after ttl time, the container needs to be deleted if total prewarmed containers is greater than minCount   
4. threshold/increment: per cold start number happened(threshold) in previous minute, the per increment prewarmed containers need to be created,
  calculation formula is:  number of new created prewarmed containers = (number of cold start in previous minute / threshold) * increment
  e.g. let's assume threshole is `1`, increment is `1` as well.
     in previous minute,
     if cold start number is `1`, increment is `1`, need to add prewarmed container: `1/1 * 1 = 1`.
     if cold start number is `2`, increment is `1`, need to add prewarmed container: `2/1 * 1 = 2`.
​
Have any suggestion?
              
​
​



Re: Adjust prewarm container dynamically

Posted by Bill Zong <bi...@163.com>.
Agree with that.


New fields would be more acceptable, since it will provide better version compatibility.


| |
Bill Zong
|
|
billzong@163.com
ShenZhen, China
|
签名由网易邮箱大师定制


Re: Adjust prewarm container dynamically

Posted by David P Grove <gr...@us.ibm.com>.
Hi,

	We should not change "count" to "initialCount".   I agree that
initialCount is a more descriptive name than "count" in the new scheme, but
changing the name will be disruptive.

--dave

Re: Adjust prewarm container dynamically

Posted by Rodric Rabbah <ro...@gmail.com>.
I think the concern is that operators with existing manifests will be broken by this change. 

I suggest a compromise. Change the manifest reader to check for the new field name and failing that look for the old field
name. I suggested this in the PR. 



-r

> On Apr 28, 2020, at 9:37 PM, 甯尤刚 <ni...@navercorp.com> wrote:
> 
> Hi, guys. 
> then, in spite of `initicalCount` is more readable than `count`, but someone afraid that `renaming the field would be a breaking change`  .
> ​
>   i think we can change count to initialCount directly,
> ​
>   And this problem: renaming the field would be a breaking change, i think it is not a problem, because this pr's all changes in invoker side only, after applied this pr to new invoker, has no bad influences on old invokers and other components(e.g.           controller).  in spite of controller has runtime info, it just has only one effect: print the detail runtime.
> ​
> 
> -----Original Message-----
> From: "甯尤刚"<ni...@navercorp.com>
> To: <de...@openwhisk.apache.org>;
> Cc:
> Sent: 2020/4/28周二 08:32 (GMT+08:00)
> Subject: Adjust prewarm container dynamically
> 
> Hi, guys. 
> ​
>     I wrote a pr here(Adjust prewarm container dynamically): https://github.com/apache/openwhisk/pull/4058
>     This feature is disabled by default. if want to use it, can add some extra configuration in runtimes.json as below
> ​
>    "stemCells": [
>         {
>           "initialCount": 2,   //filedName is changed from count to initialCount
>            "memory": "256 MB",
>            "reactive": {        
>                  "minCount": 1,
>                  "maxCount": 4,
>                  "ttl": "2 minutes",
>                  "threshold": 1,
>                  "increment": 1
>                 }
>          }
>       ]
> ​
> initialCount means create init containers when invoker starts
> reactive is optional(disabled by default), have several sub configuration
> 1. minCount: if some prewarmed containers are deleted due to unused, need to keep minCount containers not to be deleted.
> 2. maxCount:  can't create more containers more than maxCount.
> 3. ttl: if the container is not used after ttl time, the container needs to be deleted if total prewarmed containers is greater than minCount   
> 4. threshold/increment: per cold start number happened(threshold) in previous minute, the per increment prewarmed containers need to be created,
>  calculation formula is:  number of new created prewarmed containers = (number of cold start in previous minute / threshold) * increment
>  e.g. let's assume threshole is `1`, increment is `1` as well.
>     in previous minute,
>     if cold start number is `1`, increment is `1`, need to add prewarmed container: `1/1 * 1 = 1`.
>     if cold start number is `2`, increment is `1`, need to add prewarmed container: `2/1 * 1 = 2`.
> ​
> Have any suggestion?
> 
> ​
> ​
> 
> 

RE: Adjust prewarm container dynamically

Posted by 甯尤刚 <ni...@navercorp.com>.
Hi, guys. 
 then, in spite of `initicalCount` is more readable than `count`, but someone afraid that `renaming the field would be a breaking change`  .
​
   i think we can change count to initialCount directly,
​
   And this problem: renaming the field would be a breaking change, i think it is not a problem, because this pr's all changes in invoker side only, after applied this pr to new invoker, has no bad influences on old invokers and other components(e.g.           controller).  in spite of controller has runtime info, it just has only one effect: print the detail runtime.
​

-----Original Message-----
From: "甯尤刚"<ni...@navercorp.com>
To: <de...@openwhisk.apache.org>;
Cc:
Sent: 2020/4/28周二 08:32 (GMT+08:00)
Subject: Adjust prewarm container dynamically
 
Hi, guys. 
​
     I wrote a pr here(Adjust prewarm container dynamically): https://github.com/apache/openwhisk/pull/4058
     This feature is disabled by default. if want to use it, can add some extra configuration in runtimes.json as below
​
    "stemCells": [
         {
           "initialCount": 2,   //filedName is changed from count to initialCount
            "memory": "256 MB",
            "reactive": {        
                  "minCount": 1,
                  "maxCount": 4,
                  "ttl": "2 minutes",
                  "threshold": 1,
                  "increment": 1
                 }
          }
       ]
​
initialCount means create init containers when invoker starts
reactive is optional(disabled by default), have several sub configuration
1. minCount: if some prewarmed containers are deleted due to unused, need to keep minCount containers not to be deleted.
2. maxCount:  can't create more containers more than maxCount.
3. ttl: if the container is not used after ttl time, the container needs to be deleted if total prewarmed containers is greater than minCount   
4. threshold/increment: per cold start number happened(threshold) in previous minute, the per increment prewarmed containers need to be created,
  calculation formula is:  number of new created prewarmed containers = (number of cold start in previous minute / threshold) * increment
  e.g. let's assume threshole is `1`, increment is `1` as well.
     in previous minute,
     if cold start number is `1`, increment is `1`, need to add prewarmed container: `1/1 * 1 = 1`.
     if cold start number is `2`, increment is `1`, need to add prewarmed container: `2/1 * 1 = 2`.
​
Have any suggestion?
              
​
​