0

I am working on a local dev environment with Storage Explorer (connected to local emulated storage) and my webjob is triggered on new queue messages. For testing, I publish 100 queue messages and my webjob function prints a counter value to the console log:

        Interlocked.Increment(ref counter);
        log.WriteLine($"counter: {counter}");

(counter being a static int)

It takes 30 seconds to go through 100 messages. Is rate/speed expected? Is there any way to make it faster, considering that the function's operation is rather simple and doesn't write to DB/table?

I am posting this in relation to my original question to which currently there's no solution: Slow azure queue webjob performance (local dev)

Peter Bons
  • 26,826
  • 4
  • 50
  • 74
Alex E
  • 735
  • 2
  • 7
  • 15

2 Answers2

2

The local Storage Emulator is in no way indicative of the performance you'll see against a real Azure Storage Queue. The local Storage Emulator uses a local SQL Server instance that it creates behind the scenes to mimic storage services. It's slow in comparison. It also has limited support for concurrency.

To get a true test, provision a Storage Queue in Azure. For best performance, you can avoid network latency by running your processes that are enqueueing and dequeueing in the same Azure datacenter.

Rob Reagan
  • 7,313
  • 3
  • 20
  • 49
0

It depends on the size of your message of course, but I suspect the infrastructure and hardware plays a role as well. What app service plan is your webjob running on and how big are your messages?

According to the docs https://learn.microsoft.com/en-us/azure/storage/storage-performance-checklist#queues

A single queue can process approximately 2,000 messages (1KB each) per second (each AddMessage, GetMessage, and DeleteMessage count as a message here).

Without more details like the full code of what your process is it is hard to tell but in theory you should be able to get more throughput.

Peter Bons
  • 26,826
  • 4
  • 50
  • 74
  • Hi Peter, I didn't downvote your comment btw. When I reviewed answers last time, I found that it was my question that was downvoted for lacking research etc. I think your answer has good info, at least for my purposes because now I know the throughput of queue/webjob processing when it is deployed to Azure. Based on Rob's answer, it seems that my performance is suffering because I am developing/testing everything locally and storage emulator runs on Ms SQL. I will check my performance once I deploy the app to Azure. – Alex E Feb 21 '17 at 03:31