Azure Functions is a serverless computing platform that allows for event-driven scaling. This means that the number of instances of a function scales automatically based on the number of incoming events, such as messages in a queue or requests to an HTTP endpoint. This allows for cost-efficient and highly available processing of events, as the platform automatically scales up or down as needed.
Each instance of the Functions host in the Consumption plan is limited to 1.5 GB of memory and one CPU.
The unit of scale for Azure Functions is the function app - An instance of the host is the entire function app, meaning all functions within a function app share resources within an instance and scale at the same time.
Scaling can vary on a number of factors, and scale differently based on the trigger and language selected. There are a few intricacies of scaling behaviors to be aware of:
- Maximum instances: By default, Consumption plan functions scale out to as many as 200 instances, and Premium plan functions will scale out to as many as 100 instances.
- New instance rate: For HTTP triggers, new instances are allocated, at most, once per second. For non-HTTP triggers, new instances are allocated, at most, once every 30 seconds. Scaling is faster when running in a Premium plan.
Event-driven scaling in Azure Functions
In the Consumption and Premium plans, Azure Functions scales CPU and memory resources by adding additional instances of the Functions host. The number of instances is determined on the number of events that trigger a function. Each instance of the Functions host in the Consumption plan is limited to 1.5 GB of memory and one CPU.
Scalability best practices
Improve Azure Functions performance and reliability
This article provides guidance to improve the performance and reliability of your serverless function apps. For a more general set of Azure Functions best practices, see Azure Functions best practices. The following are best practices in how you build and architect your serverless solutions using Azure Functions.