HaukiDog
HaukiDog

Reputation: 141

Azure Service Bus Queue Extremely Slow

This evening we were observing extremely slow queuing time. Our trace data told us that the line

await queueClient.SendAsync(message);

was taking 45-60 seconds. This was happening for two queues which had been around for a long time. They hardly ever have more then 1-2 records and we use a web job with a ServiceBusTrigger to pull off stuff. We are putting a simple POCO on the queue. There was another queue which was queueing quickly, so for lack of any other idea I deleted the two which were being troublesome. When the code recreated them (as it was built to do) they started queueing in less than a second. Nothing else changed, expect the deletion of the old queue and the recreation of the old queue. I used the service bus explorer before and after (I wish I had taken a screenshot) and nothing changed as far as I can tell.

Any idea why such a slowdown could occur or why recreating cleared it up? We doing such low volumn stuff as it's just a pilot system.

Thanks!

Dave

Upvotes: 11

Views: 7313

Answers (3)

OutstandingBill
OutstandingBill

Reputation: 2880

A noob trap we fell into was putting a long timeout on Receive when the queue might be empty. We found it much faster to check the message count before receiving.

Upvotes: 1

HaukiDog
HaukiDog

Reputation: 141

We partitioned our queues and then removed duplicate detection and things got much better. Microsoft acknowledged there were locking issues which they were working on a solution towards. Duplicate detection restricts your queue to one partition, so this alone made no difference. They told me that they would alert us when the fix was applied and we are going to try turning on duplicate detection again.

Hope this helps! Dave

Upvotes: 3

Mikee
Mikee

Reputation: 1651

We experienced very similar issues with the Servicebus recently as well. We experienced 10-20 second slowdowns and after a couple weeks the problem suddenly disappeared. We have close connection with the Servicebus team and all they would say is that Servicebus is a shared system and the SLA only guarantees availability and NOT performance.

This should be an eye opener to anyone considering the Servicebus!

Upvotes: 11

Related Questions