Increase scale out limits for an event hub triggered azure function ?

Hafiz Omar 0 Reputation points
2026-10-07T08:01:21.9766667+00:00

I am using an Azure Function that is triggered by Event Hub messages, but during periods of heavy traffic the function does not appear to scale out enough worker instances to keep up with the incoming events. As a result, the Event Hub backlog continues to grow and message processing is significantly delayed.

The function itself is still running, but it seems that additional worker instances are not being created fast enough to handle the workload. I am currently hosting the function on an App Service plan and would like to understand whether there are Scale Out limits or settings that need to be adjusted.

Is there a way to increase the maximum number of worker instances available for scale out, or are there recommended configuration changes that can help the Azure Function process Event Hub events more efficiently and prevent backlog accumulation ?

Windows for business | Windows 365 Business
0 comments No comments

2 answers

Sort by: Most helpful
  1. HLBui 13,340 Reputation points Independent Advisor
    2026-10-07T08:41:00.67+00:00

    Hi Hafiz Omar

    What you're seeing is the scaling behavior of Azure Functions when processing Event Hub partitions under sustained load. If you're running on an App Service Plan, I'd first recommend reviewing the maximum instance count configured for your plan and verifying that the plan tier actually supports the level of scale-out you're expecting.

    Another important point is that Event Hub-triggered Functions scale based on partition distribution and workload characteristics, so simply increasing the instance limit may not always result in faster processing. It's also worth checking your Event Hub partition count, batch size settings, prefetch count, and the concurrency configuration in host.json, as these can have a significant impact on throughput.

    Please , monitoring Function execution duration, CPU utilization, memory consumption, and Event Hub backlog metrics at the same time. If worker instances are available but processing remains slow, the bottleneck may be inside the function code itself rather than in the scaling mechanism.

    For workloads with frequent traffic spikes, many customers see better results by increasing partition counts, optimizing function execution time, and ensuring the App Service Plan has sufficient resources before raising scale-out limits. Reviewing the scale controller logs can also provide valuable insight into why additional instances are not being added as quickly as expected.

    If you find this answer helpful, please consider clicking "Accept Answer" so it can help others facing a similar issue.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-10-07T08:01:47.49+00:00

    Yes. On an App Service plan, Azure Functions uses Dedicated (App Service) plan scaling, which does not use automatic event-driven scale-out for Event Hubs. In that plan, instances must be manually configured or controlled with an App Service autoscale rule. That is the main reason backlog can grow during heavy traffic.

    For Event Hubs-triggered functions, the practical scale-out limit is also tied to the number of Event Hub partitions. The number of concurrent function instances can equal the number of partitions, and that partition count is effectively the maximum target instance count for this workload.

    Recommended changes:

    1. Check the hosting plan
      • If the app is on a Dedicated/App Service plan, configure more instances manually or set up autoscale.
      • If event-driven scaling is required, use a plan that supports it. The documentation recommends Flex Consumption for serverless Event Hubs workloads. In Flex Consumption, Event Hubs-triggered functions scale per function by using target-based scaling.
    2. Verify Event Hub partition count
      • Maximum parallelism is achieved when there is roughly a one-to-one relationship between partitions and function instances.
      • If the event hub has too few partitions, scale-out cannot go beyond that parallelism target.
      • Partition count is fixed after creation except in Premium and Dedicated Event Hubs tiers.
    3. Tune Event Hubs trigger settings in host.json
      • For Event Hubs extension v5.x+, maxEventBatchSize affects target executions per instance.
      • targetUnprocessedEventThreshold can be set separately to control target-based scaling without changing batch settings.
      • If using target-based scaling, avoid setting batchCheckpointFrequency above 1 because it can cause incorrect scaling behavior and prevent proper scale-in.
    4. Increase per-instance throughput
      • Enable batch processing where possible. Event Hubs performs better when messages are received in batches.
      • Adjust batch size in host.json.
      • Increase FUNCTIONS_WORKER_PROCESS_COUNT to raise the number of worker processes per host, up to 10. This helps especially for single-threaded runtimes.
    5. Reduce contention inside the function app
      • Host the Event Hubs-triggered function in its own function app if other functions are CPU- or memory-intensive.
      • Give each function app its own storage account.
      • Use a dedicated consumer group for each function app.
    6. If throughput still exceeds current Event Hubs capacity
      • If the workload exceeds the maximum allowed throughput units, move to Event Hubs Premium or Dedicated tier.

    In short: if the function is on an App Service plan, there is no Event Hubs-driven automatic scale-out to increase by a Functions setting alone. Increase App Service instances or autoscale, and validate that the Event Hub has enough partitions. For the best automatic scaling behavior with Event Hubs, move the workload to Flex Consumption and tune batching and worker-process settings.


    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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