Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Functions still “Cold Start” in Consumption plan when keep alive request sent per 4 mins

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?

like image 602
Will Huang Avatar asked Jun 07 '18 03:06

Will Huang


People also ask

How do you stop a cold starting Azure function?

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.

How long can an Azure function run for on consumption plan?

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.

Which properties of Azure Functions are used for billing when the consumption plan is used?

Consumption. Azure Functions consumption plan is billed based on per-second resource consumption and executions.

How long do Azure Functions stay warm?

Once your Function executed, it will stay 'warm' for the next 20 minutes or so, to execute subsequent requests.


1 Answers

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.

like image 130
Mikhail Shilkov Avatar answered Oct 12 '22 10:10

Mikhail Shilkov