It looks like you're experiencing scaling issues with your Azure Function App when processing messages from a Service Bus subscription. You mentioned the app is only scaling to 11 instances despite having a max limit set to 100. Here are a few things you can check or try to help optimize scaling:
Concurrency Settings: The default settings may allow multiple messages to be processed per instance. Check your host.json
file for the maxConcurrentCalls
setting under the Service Bus trigger section. If this is set higher than 1, the function will process multiple messages at once, which could impact how the scaling is performed.
Processing Time: Analyze the time it takes for each function instance to process a message. If the processing is slow, it could prevent new instances from being spun up. You may need to optimize the function code for speed.
Message Volume: Ensure that the messages in the Service Bus are being received in bulk and that the queue isn't empty at intervals. If the Function App doesn't sense an ongoing demand, it may not scale as aggressively.
Plan Limits: Since you're on a Premium Plan with 3.5GB + 1CPU, ensure you are not hitting any resource quotas. You can monitor metrics in the Azure portal to check if you are hitting any limits.
Pre-Warmed Instances: Consider configuring pre-warmed instances to help handle bursts of load without the usual startup delay.
Feel free to tweak these settings or investigate the mentioned areas to encourage the scaling you desire.
If you need more help, could you please provide the following details?
- What is the current value of
maxConcurrentCalls
in yourhost.json
? - How long does it generally take to process a single message?
- Are there any errors or warnings in the logs that might indicate why scaling isn't happening as expected?
Hope this helps. Do let us know if you have any further queries.
If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.