-
Notifications
You must be signed in to change notification settings - Fork 57
feat: add warmup plugin #57
Conversation
|
Do we need to any any configuration to set this to work out of the box? I know their repo has a lot of custom config, but are there defaults? Can you dig in more and add what you learn to the README, replacing, where relevant, what we currently have re: running warm in the readme? |
|
@adampash yes sure, the configs I put are the ones needed so that this setup is identical to the old setup. They have a lot of options that users can configure and I inserted the link |
| enabled: true | ||
| - schedule: rate(5 minutes) | ||
| prewarm: true | ||
| concurrency: 2 |
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.
Let's add some explanatory text here. E.g., does this just warm all your lambdas now?
If so, maybe text like:
The above config would keep all of your deployed lambda functions running warm. The
prewarmflag will ensure your function is warmed immediately after deploys (so you don't have to wait five minutes for the first scheduled event). And by setting theconcurrencyto2, we're keeping two instances warm for each deployed function.
I don't know if the above is correct, so can you verify?
Also it's worth pointing out that custom is for setting project-wide warmup behaviors, but you can set per-function behavior by setting config under a warmup key.
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.
This is all correct!
serverless.yml
Outdated
| events: | ||
| - schedule: rate(5 minutes) | ||
| prewarm: true | ||
| concurrency: 2 |
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.
Let's keep the default concurrency at 1, but leave it here, since it's a common one they may want to adjust.
adampash
left a comment
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.
👍
Added
serverless-plugin-warmupthat replaces the old warmup config