3

We have created a blob triggered azure function to process files placed in blob storage. Load on this blob will not be consistent. For example, for some hours there will be hundreds or even thousands of file will be placed in that blob every minutes. On the other hand there will be some hours during which we will not find even a single file. Some files will be processed in very few seconds and some can take more than 10-15 minutes.

So my question is: In this type of unpredictable scenario which plan will be better for us? App service plan or Consumption plan?

Yash
  • 356
  • 1
  • 5
  • 22
  • 1
    The doc says: "The default timeout for functions on a Consumption plan is 5 minutes. The value can be increased for the Function App up to a maximum of 10 minutes by changing the property functionTimeout in the host.json project file." – CSharpRocks Jan 08 '19 at 13:51
  • Thank you PeterBons and CSharpRocks for support. Suppose some how I optimize the code which grantees that all files will be processed within 10 minutes. In this case which plan will be better for me? – Yash Jan 08 '19 at 14:22

1 Answers1

3

If you can optimize your code so that the maximum processing time is 10 minutes, so Consumption Plan is your best option from cost perspective considering your fluctuating workload

As @Peter Bons, mentioned in the comments, this is your best reference

Edit

According to the above document,

if your function app is on the Consumption plan, there can be up to a 10-minute delay in processing new blobs if a function app has gone idle.

If you want to avoid that delay and still use consumption plan to benefit from its cost effectiveness, you can replace Blob Trigger with Event Grid Trigger but it is not fully supported by Azure Functions nowadays

Muhammad Gouda
  • 849
  • 8
  • 20
  • Thanks Gouda. But the cortical in page says: "When you're using a blob trigger on a Consumption plan, there can be up to a 10-minute delay in processing new blobs." and "To avoid this cold-start delay, use an App Service plan with Always On enabled" In this case in the hours of high load, My blob will be full of files in 10 minutes. – Yash Jan 08 '19 at 14:42
  • @Yash, you can rely replace blob trigger with event grid trigger to avoid this delay and keep using Consumption plan. – Muhammad Gouda Jan 08 '19 at 14:50
  • @Guda Thank you so much. I think this is going to help me. and that 10 minute run limit is for event grid trigger also. Correct? – Yash Jan 08 '19 at 14:58
  • No, event grid trigger will not introduce delays. check this https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-event-grid – Muhammad Gouda Jan 08 '19 at 15:01
  • One more thing. When I try to create event grid triggered azure function. It gives me following message: "This language is experimental and does not yet have full support. If you run into issues, please file a bug on our GitHub repository." – Yash Jan 08 '19 at 15:02
  • I have not asked about 10 minute delay. I have asked about maximum processing time of 10 minutes. That is applicable on event grid trigger too. correct? – Yash Jan 08 '19 at 15:03
  • Aha!, the answer is "No" as well for the processing time, but you will have to live with any bugs till event grids get fully supported by functions. it's trade-offs :) – Muhammad Gouda Jan 08 '19 at 15:07
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/186363/discussion-between-yash-and-gouda). – Yash Jan 08 '19 at 15:09