Logic Apps Performance with Service Bus

In this post, we will measure the throughput for Logic App to consume messages from a Service Bus queue using the Service Bus connector.

Single message trigger

Let’s create a new Logic App with the just the trigger “When a message is received in a queue (auto-complete)” provided by the Service Bus connector.

single-message-trigger

We pre-populated the queue with 10,000 messages. It takes 25.5 minutes for the Logic App to drain all messages from the queue, i.e. at the rate of 6.5 messages per second.

Batch messages trigger

Now let’s create another Logic App with the batch trigger “When one or more messages arrive in a queue (auto-complete)”. The trigger configuration are as follows –

  1. Maximum message count – starting from 5 going up to 175 (max limit) across test runs
  2. Polling frequency – 30 seconds

batch-messages-trigger

Again, we pre-populated the queue with 10,000 messages. It takes just 6 minutes with batch size of 5 for the Logic App to drain all messages from the queue, i.e. at the rate of 27.5 messages per second. As we increase the batch size to the maximum allowed value of 175, the throughput goes up to 400 messages per second.

batch-size-vs-throughput

Competing consumers

We can further increase the overall throughput with multiple Logic Apps (competing consumers scenario). Let’s create 10 Logic Apps with batch size of 175. We pre-populated the queue with 100K messages, i.e. 10 times more than previous runs to give enough time for competing logic apps to consume enough messages. It takes just 71 seconds for these Logic Apps to drain all messages from the queue, i.e. at the overall rate of 1408 messages per second.

competing-consumers

We should be able to scale further by adding more competing Logic Apps.

Summary

Here’s the result summary of various runs.

results-summary