Azure / Azure/azure-functions-host
Function App Concurrency and Dynamic Scaling does not seem to work
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
I have a consumption based function app (.Net 6, running in 64-bit mode) that keeps getting the warning "Your app is not configured for dynamic scaling. Scaling could be limited. Click to learn more."

However, the thing is that dynamic scaling is enabled by having the following in the host.json file:
```
"concurrency": {
"dynamicConcurrencyEnabled": true,
"snapshotPersistenceEnabled": true
}
```
Something with scaling also seems off, not sure if it's related though.
It's a simple servicebus trigger, and if I add 10k message on the queue, the maximum throughput I get is 10 messages / second.
I should say that each messages take approx. 1.5s to process, but it's mostly idle/latency time due to other reasons.
The CPU is almost idle (avg cpu utilization is 7%) and most of the processing is done in the database (which peaks at 7%)
Checking the logs I can see that it's the same host instance that processes everything, so it seems it's never scaling out.
The persisted concurrency settings states that e.g. ProcessTrackingEventMessagesSBTrigger could run 503 executions in parallell - but that never happens.
```
{
"Timestamp": "2024-10-30T19:40:37.6565727Z",
"NumberOfCores": 2,
"FunctionSnapshots": {
"Host.Functions.ProcessTrackingEventMessagesSBTrigger": {
"Concurrency": 503
},
"Host.Functions.ProcessCanonicalEvents": {
"Concurrency": 54
},
"Host.Functions.ProcessPersistMessagesSBTrigger": {
"Concurrency": 134
},
"Host.Functions.ProcessLogMessagesSBTrigger": {
"Concurrency": 202
}
}
}
```
I've run out of ideas of what might be wrong at the moment.
Contributor guide
Research direction
Start with the host.json concurrency configuration and the Service Bus trigger described in the report. Review the persisted FunctionSnapshots, host-instance logs, CPU and database metrics, and the dynamic-scaling warning to determine whether the configured concurrency is being applied. Done means the cause of the warning and single-instance behavior is identified and the expected scaling behavior is verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100