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?