Description
Have a set of functions that are all using Flex Consumption and are using Service Bus Topics (single message) as a trigger
Each function does the following
- Receive Message from Service Bus
- Update Azure SQL
- Either add another message to a service bus topic or not
- Complete Message
Under load Azure SQL was running out of DTU's due to the amount of concurrent functions running.
Followed guidance as per https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-functions/functions-target-based-scaling.md#service-bus-queues-and-topics
Host.json for each function configured as follows
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
},
"enableLiveMetricsFilters": true
}
},
"extensions": {
"serviceBus": {
"maxConcurrentCalls": 1
}
}
}
Application configuration has the following configuration added:
{
"name": "WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT",
"value": "1",
"slotSetting": false
}
No difference found in application scaling Azure SQL still running out of DTU's due to scale out of Azure Functions which seems to be ignoring configuration
Repro steps
Add 300 messages to initial SB topic
Expected behavior
Concurrency of service bus concurrency processing constrained due to configuration above
Actual behavior
SQL DTU running at 100% (S4 SKU used with 200DTU limit).
Many concurrent functions running at same time observable in invocation logs
Investigative information
- Function App version: Flex Consumption
- Function App name: plan-clapoc-core-test-lla-storeandforward-uksouth, plan-clapoc-core-test-lla-preprocessor-uksouth, plan-clapoc-core-test-lla-enrich-uksouth, plan-clapoc-core-test-lla-search-uksouth, plan-clapoc-core-test-lla-reduce-uksouth
- Function name(s) (as appropriate): func-clapoc-core-test-lla-storeandforward, func-clapoc-core-test-lla-preprocessor, func-clapoc-core-test-lla-enrich, func-clapoc-core-test-lla-search, func-clapoc-core-test-lla-reduce
- Region: UK South
-Nuget Service bus extension Microsoft.Azure.Functions.Worker.Extensions.ServiceBus" Version="5.22.0"
Known workarounds
Only workaround is to limit rate of ingress into initial service bus topic
Related information
Provide any related information
-
Programming language used : C#
-
Bindings used
All functions follow same pattern but use a different Service Bus Subscription/filter[Function(nameof(StoreAndForward))] public async Task Run( [ServiceBusTrigger("sbt-clapoc-storeandforward", "storeandforward", Connection = "ServiceBus_ConnectionString")] ServiceBusReceivedMessage message, ServiceBusMessageActions messageActions) { await base.RunFunction(message, messageActions); }