I already read Understanding Serverless Cold Start | Azure App Service Team Blog article. One the the comments said You can avoid cold start in consumption plan also by calling function from Azure Logic app in every 4 mins interval.
I was trying to make 1 request per 4 minutes to one function of my app but this doesn’t always works. It sometimes still cold start. I know it's a hack. Is there any better way to ensure App always running when using Consumption plan?
Avoiding cold start altogetherDedicated Mode: As mentioned before, running Functions in an App Service Plan alleviates these issues since you control what happens on your VM.
Consumption plan uses Azure Files for temporary storage. When your function app is hosted in a Consumption plan, only the CNAME option is supported. For function apps in a Premium plan or an App Service plan, you can map a custom domain using either a CNAME or an A record. Guaranteed for up to 60 minutes.
Consumption. Azure Functions consumption plan is billed based on per-second resource consumption and executions.
Once your Function executed, it will stay 'warm' for the next 20 minutes or so, to execute subsequent requests.
I tried to answer this question in my article Cold Starts Beyond First Request in Azure Functions.
In short, there doesn't seem to be a way to avoid cold starts completely. Keep alive calls will make the life span of a given instance longer, but it won't make it indefinitely long.
For now, Cold Starts seem to be a genuine issues of FaaS implementations, they get optimized over time, but probably you won't be able to reduce them to 0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With