2
votes

I am planning to using ServiceBusTrigger in Azure functions. I know that under Consumption plan, functions might stop running due to inactivity after a certain period of time as mentioned here.

We deallocate resources after roughly 20 minutes of inactivity, after which your next call will be a cold start

So let's say my function app has been stopped due to inactivity. I understand that a HTTPTrigger will wake up my app. It will be slow due to cold start, but at least the delay is only as long as the cold start (few seconds assuming lightweight initialization).

Questions

  1. How are ServiceBusTriggers handled once an app is deallocated? If a new message comes, will the function get triggered immediately? Cold start penalty is ok, but could it be more like in tens of minutes? This comment about blob triggers indicate it could take up to 10 minutes, but I am not sure if it applies to Service Bus also.

    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.

  2. Assuming that there could be delays in tens of minutes, could this be reduced by using Premium plan or App Service Plan with "Always On" set?

1

1 Answers

0
votes
  1. You are referring to 2 separate triggers: servicebus and blob. Blob triggers are slow, but definitely not tens of minutes. Servicebus triggers are very fast.
  2. Yes you can reduce your cold start by going with an app service plan, but I'm not seeing any indication that you would benefit from this. You might save a second or two.

It seems like you are experiencing latency and you are unable to identify the root cause. Triggers are fast.