title: Scaling # of parallel instances for a queue-triggered azure function
body: <p>I’m trying to better understand how azure function scaling works under a consumption plan.</p>
  
  <p>I have been testing an app that inserts 1000 messages in a storage queue, which triggers an azure function written in C#.</p>
  
  <p>The function downloads a file and performs some processing on it. It takes around 20 seconds to complete each request.</p>
  
  <p>Running the function on a consumption plan, I am seeing it take upwards of 10 minutes to fully drain the queue. Configuring each function instance to process only one queue message at a time, I would have expected 1000 instances to be launched for 1000 messages, but that does not appear to be the case.</p>
  
  <p>Using the Live Metrics Stream on App Insights, I never saw the # of running instances go over 30.</p>
  
  <p>Is this sort of throughput expected? For reference, here is my queue configuration in the function’s host.json:</p>
  
  <pre><code> "queues": {
      "maxPollingInterval": 2000,
      "visibilityTimeout": "00:00:30",
      "batchSize": 1,
      "maxDequeueCount": 5,
      "newBatchThreshold": 1
    }
  </code></pre>
  
  <p>Any information that could be provided on the scaling capabilities, or suggestions to achieve better throughput here would be appreciated.</p>