Hands-On Serverless Computing
上QQ阅读APP看书,第一时间看更新

Cold start

I have already discussed cold start earlier in the chapter. Let's recap about the concern we have regarding cold start. The concern about cold start is that a function takes slightly longer to respond to an event after a period of inactivity. The time it takes varies between the run times that your application chooses.

This does tend to happen, but there are ways around the cold start if you need an immediately responsive function. If you know your function will only be triggered periodically, an approach to overcoming the cold start is to establish a scheduler that calls your function to wake it up every so often. Within AWS, you can use CloudWatch Event Scheduler to have your Lambda function invoked every 5 to 10 minutes so that AWS Lambda will not mark your function as inactive or cold. Azure Functions and Google Functions also have similar capability to have functions invoked on a schedule.