question

JoeyJ-9764 avatar image
0 Votes"
JoeyJ-9764 asked MayankBargali-MSFT commented

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

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-functionsazure-service-bus
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered MayankBargali-MSFT commented

@JoeyJ-9764 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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I'm using different session ids. When I see only a few az funcs processing messages, I send even more to the queue (the same distribution of session ids) and suddenly the other azure functions pick up messages.

0 Votes 0 ·

@JoeyJ-9764 Can you share the sample code how the load test is generated along with your function app code so I can verify the same at my end.

0 Votes 0 ·