-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document for prewarmed container #4910
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4910 +/- ##
===========================================
- Coverage 81.51% 67.85% -13.66%
===========================================
Files 220 226 +6
Lines 10731 12021 +1290
Branches 444 493 +49
===========================================
- Hits 8747 8157 -590
- Misses 1984 3864 +1880
Continue to review full report at Codecov.
|
docs/prewarm.md
Outdated
|
||
* Some prewarmed containers will be deleted if they are expiration, this can save some memory resource. | ||
* Create a certain range prewarmed conainers according to the cold start in same kind on next schedule time, e.g. | ||
- cold start number = 2, number of prewarmed container will be created = cold start number(2)/threshold(2) * increment(1) = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't threshold 1 in the above example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the prewarm.md's content to actions.md
.
Regarding Isn't threshold 1 in the above example?
I changed like below
"stemCells": [
{
"initialCount": 2,
"memory": "256 MB",
"reactive": {
"minCount": 1,
"maxCount": 4,
"ttl": "2 minutes",
"threshold": 2, # here, changed from 1 to 2, need to keep the same.
"increment": 1
}
]
docs/prewarm.md
Outdated
# | ||
--> | ||
|
||
# runtimes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can skip this part as there is this part?
https://github.com/apache/openwhisk/blob/master/docs/actions.md#languages-and-runtimes
Instead of this, we may add a section to briefly describe why we need prewarm containers and the effect of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already moved to actions.md
's ## Languages and Runtimes
section.
docs/prewarm.md
Outdated
|
||
# Prewarmed container without `reactive` | ||
|
||
Prewarmed containers are created when invoker starts, they are created according to runtimes.json's stemCells, e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prewarmed containers are created when invoker starts, they are created according to runtimes.json's stemCells, e.g. | |
Prewarmed containers are created according to the stemcell configuration in the `runtime.json` file at the invoker bootup time, e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description is more accurate, already updated accordingly.
docs/prewarm.md
Outdated
when user invokes actions, these relative activations are run on docker containers which base on | ||
these runtime docker images. | ||
|
||
# Prewarmed container without `reactive` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Prewarmed container without `reactive` | |
# How prewarm containers are provisioned without a reactive configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description is more accurate, already updated accordingly.
docs/prewarm.md
Outdated
the activation will be scheduled on prewarmed container firstly, then subsequent activation will be scheduled on warmed containers. | ||
because prewarm container is already created in advance, so this can avoid `cold start`. | ||
|
||
# Prewarmed container with `reactive` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Prewarmed container with `reactive` | |
# How prewarmed containers are provisioned with a reactive configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description is more accurate, already updated accordingly.
docs/prewarm.md
Outdated
} | ||
``` | ||
`reactive` fields explanation: | ||
* minCount: exist at least `minCount` prewarmed containers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* minCount: exist at least `minCount` prewarmed containers. | |
* `minCount`: the minimum number of prewarm containers. The number of prewarm containers can't be fewer than this value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description is more accurate, already updated accordingly.
docs/prewarm.md
Outdated
``` | ||
`reactive` fields explanation: | ||
* minCount: exist at least `minCount` prewarmed containers. | ||
* maxCount: can't create more than `maxCount`prewarmed containers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* maxCount: can't create more than `maxCount`prewarmed containers. | |
* `maxCount`: the maximum number of prewarm containers. The number of prewarm containers cannot exceed this value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description is more accurate, already updated accordingly.
docs/prewarm.md
Outdated
`reactive` fields explanation: | ||
* minCount: exist at least `minCount` prewarmed containers. | ||
* maxCount: can't create more than `maxCount`prewarmed containers. | ||
* ttl: the prewarmed conainers will be deleted due to expiration, because they are not used in ttl time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* ttl: the prewarmed conainers will be deleted due to expiration, because they are not used in ttl time. | |
* `ttl`: the amount of time that prewarm containers can exist without any activation. If no activation for the prewarm container arrives in the given time, the prewarm container will be removed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description is more accurate, already updated accordingly.
docs/prewarm.md
Outdated
* minCount: exist at least `minCount` prewarmed containers. | ||
* maxCount: can't create more than `maxCount`prewarmed containers. | ||
* ttl: the prewarmed conainers will be deleted due to expiration, because they are not used in ttl time. | ||
* threshold and increment: these two fileds are used together to calculate the new created number of prewarmed containers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* threshold and increment: these two fileds are used together to calculate the new created number of prewarmed containers. | |
* `threshold` and `increment`: these two configurations control the number of new prewarm containers to be created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description is more accurate, already updated accordingly.
docs/prewarm.md
Outdated
* ttl: the prewarmed conainers will be deleted due to expiration, because they are not used in ttl time. | ||
* threshold and increment: these two fileds are used together to calculate the new created number of prewarmed containers. | ||
|
||
How to support `adjust the prewarmed container resource dynamically` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to support `adjust the prewarmed container resource dynamically` | |
The number of prewarmed containers is dynamically controlled when: | |
* they are expired due to a TTL, some prewarmed containers are removed to save resources. | |
* cold starts happen, some prewarm containers are created according to the following calculus. | |
* `# of prewarm containers to be created` = `# of cold starts` / `threshold` * `increment`. | |
* ex1) `cold start number(2)` / `threshold(2)` * `increment(1)` = 1 | |
* ex2) `cold start number(4)` / `threshold(2)` * `increment(1)` = 2 | |
* ex3) `cold start number(8)` / `threshold(2)` * `increment(1)` = 4 | |
* ex4) `cold start number(16)` / `threshold(2)` * `increment(1)` = 4 (cannot exceed the maximum number) | |
* no activation arrives for long time, the number of prewarm containers will eventually converge to `minCount`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your description is more accurate, already updated accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work.
ea4871a
to
ee9304f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a minor nit.
docs/actions.md
Outdated
@@ -82,6 +82,84 @@ You can create a new runtime in two ways: | |||
Follow the instructions in [Updating Action Language Runtimes](actions-update.md) for updating, removing or renaming | |||
runtime kinds or language families. | |||
|
|||
### How prewarm containers are provisioned without a reactive configuration | |||
|
|||
Prewarmed containers are created when invoker starts, they are created according to runtimes.json's stemCells, e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prewarmed containers are created when invoker starts, they are created according to runtimes.json's stemCells, e.g. | |
Prewarmed containers are created when an invoker starts, they are created according to runtimes.json's stemCells, e.g. |
docs/actions.md
Outdated
|
||
The number of prewarmed containers is dynamically controlled when: | ||
* they are expired due to a TTL, some prewarmed containers are removed to save resources. | ||
* cold starts happen, some prewarm containers are created according to the following calculus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* cold starts happen, some prewarm containers are created according to the following calculus | |
* cold starts happen, some prewarm containers are created according to the following calculus. |
ee9304f
to
4c491da
Compare
Description
In slack, some guys said, didn't know how prewarmed conainers works, so i add the
document for prewarmed container
Related issue and scope
My changes affect the following components
Types of changes
Checklist: