1
votes

I have an azure function listening to a service bus queue trigger using the dynamic consumption plan. Based on this documentation of the host.json config...

https://github.com/Azure/azure-webjobs-sdk-script/wiki/host.json

... you can set the following values

"serviceBus": {
  // The maximum number of concurrent calls to the callback the message
  // pump should initiate. The default is 16.
  "maxConcurrentCalls": 16,
  // The default PrefetchCount that will be used by the underlying MessageReceiver.
  "prefetchCount": 100
},

Is there any documentation on setting the above for use with functions - particularly using a consumption plan.

The service bus performance best practices documentation suggests:

https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-performance-improvements

When using the default lock expiration of 60 seconds, a good value for >SubscriptionClient.PrefetchCount is 20 times the maximum processing rates of >all receivers of the factory. For example, a factory creates 3 receivers, and >each receiver can process up to 10 messages per second. The prefetch count >should not exceed 20*3*10 = 600. By default, QueueClient.PrefetchCount is set >to 0, which means that no additional messages are fetched from the service.

Can somebody please shed some light on how these are/should be used within functions?

Thanks!

1

1 Answers

2
votes

Looking at the ASB code for Azure WebJobs (base for Functions) it looks like there's a single receiver that is created. Hence the settings that you see that take into consideration a single receiver created.

ASB performance documentation is describing a scenario where you create your own message pumps and control number of factories and receivers.