I'm doing research on Azure service bus queue load balancing. I've found that "As the load increases, more worker processes can be added to read from the queue." Does it mean that I need implement code to auto scale the worker roles, or service bus queues having built in capability to increase or decrease the workers to process the events depending on the load?
Asked
Active
Viewed 1,395 times
0
-
4Have a look at Azure Functions with Consumption Plan - they will do scaling for you – Mikhail Shilkov Feb 07 '18 at 08:19
1 Answers
2
Does it mean that I need implement code to auto scale the worker roles, or service bus queues having built in capability to increase or decrease the workers to process the events depending on the load?
Azure Service Bus is simply a messaging store. It does not know about the message consumers (worker roles in your case). Thus it does not have the capability to scale up/down workers. This is something that you would need to do on your own.
However, you don't need to write code to do so. Azure provides auto scaling
capabilities that you can configure. Once you have configured the autoscaling properly, Azure will automatically scale up/down your worker instances based on the configuration.

Gaurav Mantri
- 128,066
- 12
- 206
- 241
-
1To add a little more to Guarav's answer, if you're draining your Service Bus Queue with a WebJob that uses a Service Bus Trigger, you can set up autoscale on the Web App that's hosting your WebJob. One of the WebJob auto-scale metrics is that you can look at the number of messages in a Service Bus Queue. If it exceeds a threshold, automatically scale out additional instances. This is very useful for load leveling. – Rob Reagan Feb 07 '18 at 14:07
-
@Gaurav Mantri, Rob Reagan, thank you very much for the clarification. As suggested I have gone through auto scaling. We can do the auto scaling if we use the dedicated plan, but if we use consumption plan, we can not control the number of instances created. But, I want to know for partitioned service bus queues how the instances(for service bus trigger) will be created, instances will be created per partition or they will created randomly according to the queue size. – Jay Mar 01 '18 at 10:22