Reputation: 1251
I have an Azure HttpTrigger function which processes POST requests and scales out on heavy load. The issue is that the caller of the function only waits 3 sec. for a HTTP 200 status code. But when an azure function scales out it takes 4-6 sec. until the request gets processed. If the caller sends a request during the scale out it is possible that he cancels the request and my service is never be able to process it. Which is a worst case scenario.
Is there a way to prevent that? My ideal scenario would be an immediate HTTP 202 answer to the caller. But I'm afraid that this is not possible during a scale out process.
Upvotes: 1
Views: 1166
Reputation:
A Scale-out will require your app to be loaded onto another instance so some delay occurs/incur for those requests because of time taken to load your app onto the new instance.
As described in the Official Documentation:
Consumption Plan is the true serverless hosting plan since it enables scaling to zero when idle state, but some requests might have additional latency at startup.
To get constant low latency with autoscaling, you should move to the premium hosting plan which avoids cold starts with perpetually warm instances.
Upvotes: 2