Function app constant app scale on bulk service bus message.

Muhammad Ehtesham 0 Reputation points
2025-05-08T15:25:32.1466667+00:00

Hi, There is a bulk of messages in service bus subscription and each message is supposed to be processed by single function app instance. When we push bulk in service bus subscription then function app scale up 11 instance only. Max limit is set to 100 and minimum limit is set to 1. It should scale as much it can but that is not happening. I would like to scale this function app as much as it can under 100 max limit.

Function App Plan : Premium EP:1 (3.5GB + 1CPU)

Operating System: Windowsscaling

function

Thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,782 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Khadeer Ali 5,065 Reputation points Microsoft External Staff Moderator
    2025-05-12T17:15:50.92+00:00

    @Muhammad Ehtesham ,

    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 your host.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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.