Azure Function Service Bus Trigger is not processing messages on all instances

Joey J 1 Reputation point
2021-09-16T21:02:35.94+00:00

I have a service bus trigger with sessions enabled on a partitioned queue. I've pushed 1000 messages to the queue to check the perf. I'm seeing max 12 messages/sec processed on only a few of the azure function instances. I'm unsure what issue I'm hitting. Strangely, I'm seeing the load distributed across more of the instances when I push even more messages to the queue, which I wouldn't expect.

Also, I'm using Elastic scaling with a burst of 100 and minimum instances set to 1. And it's sitting at 12 instances according to AI with 10 of them doing no work. The instances shouldn't stick around if they are idle, no?

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
544 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,249 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 68,471 Reputation points
    2021-09-20T06:21:58.96+00:00

    @Joey J Can you confirm if you have send the messages to different sessions? It looks like you are sending messages using the same session ID when you do the send messages. Messages with the same session will be recieved by the same consumer. During your load test please try sending messages with different session ID and see if you observed the same behaviour. Please refer to message session on how the session works.

    As you have mentioned that when you send more message then it distribute the load so looks like your test application always send message to the new session when you start it again.