Azure Functions – Scaling with a Dedicated App Service Plan

After my last few posts on the scaling of Azure Functions I was intrigued to see if they would perform any better when run on a dedicated App Service Plan. Hosting them in this way allows the functions to take full advantage of App Service features. However, to my mind, this is no long a serverless approach as rather than being billed based on usage you are essentially renting servers and are fully responsible for scaling.

I conducted a single test scenario: an immediate load of 400 concurrent users running for five minutes against the “stock” JavaScript function (no external dependencies, just returns a string) on four configurations:

  1. Consumption Plan – billed based on usage – approximately $130 per month
    (based on running constantly at the tested throughput that is around 648 million functions per month)
  2. Dedicated App Service Plan with 1 x S1 server -$73.20 per month
  3. Dedicated App Service Plan with 2 x S1 server – $146.40 per month
  4. Dedicated App Service Plan with 4 x S1 server – $292.80 per month

 

I also included AWS Lambda as a reference point.

The results were certainly interesting:

With immediately available resource, all three App Service Plan configurations begin with response times slightly ahead of the Consumption Plan. At around the one minute mark however, the Consumption Plan overtakes our single instance configuration, creeping ahead of the double instance configuration at two minutes, and, while the advantage is slight, at three minutes begins to consistently outperform our four instance configuration. However, AWS Lambda remains some way out in front.

From a throughput perspective, the story is largely the same with the Consumption Plan taking time to scale up and address the demand but ultimately proving more capable than even the 4x S1 instance configuration, knocking on the door of AWS Lambda. What I did find particularly notable is the low impact of moving from two to four instances on throughput. The improvement in throughput is massively disappointing – for incurring twice the cost we are barely getting 50% more throughput. I have insufficient data to understand why this is happening but do have some tests in mind that, time allowing, I will run and see if I can provide further information.

At this kind of load (650 million requests per month), from a bang per buck point of view, Azure Functions on the Consumption Plan come out stronger compared to App Service instances, even if we don’t allow for quiet periods when Functions would incur less cost. If your scale profile falls within the capabilities of the service, it’s worth noting that currently there isn’t a Service Level Agreement around Functions when running on the Consumption Plan – and to be fair the same applies to AWS Lambda.

Leave a Reply

Your email address will not be published. Required fields are marked *