Skip to content
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

[Clarification] What is prewarm actually doing? #347

Closed
kaldown opened this issue Oct 12, 2023 · 1 comment
Closed

[Clarification] What is prewarm actually doing? #347

kaldown opened this issue Oct 12, 2023 · 1 comment
Labels

Comments

@kaldown
Copy link

kaldown commented Oct 12, 2023

Hello.

Thank you for the great plugin.
I read the documentation and there are still question for me for a certain argument: prewarm.

Reading this line I concluded that this will start first warmup request for the given function. Instead waiting for the scheduler to take place.

Now I'm not sure I understand it correctly. Could you please clarify if I have to set prewarm: true to warmer to work at least?
Because this exmplanation now leads me to the conclusion that I have to prewarm functions myself after deploy.

Could I omit prewarming if I only need to warmup to take place upon my schedule (cron for instance)?

Thank you.

@juanjoDiaz
Copy link
Owner

Prewarm simply invokes your warmers right after the deployment.
This means that all your lambdas that have a warmer setup will be invoke (1 or more times based on the concurrency setting).
This is good to avoid cold start right after deploying.

Also, if at any point in time you want to call the warmers you can use the prewarm option of the cli.

# Either invoking all warmers
serverless warmup prewarm
# some specific one
serverless warmup prewarm -warmers <warmer_name>
# some several
serverless warmup prewarm -warmers <warmer_name>,<another_warmer_name>

If you only need the warmers to run based on your schedule, you don't need prewarm.

@kaldown kaldown closed this as completed Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants