Azure Functions Memory Calculator
Azure Functions doesn't take a free-form memory value: the hosting plan fixes the instance size. Flex Consumption offers 512, 2048 and 4096 MB instances, and anything larger needs an Elastic Premium SKU (EP1–EP3). An instance that runs out of memory is recycled and its in-flight executions fail. This calculator sizes from peak usage and picks the smallest instance that fits.
01 Usage data
Where do I get these numbers?
In Azure Monitor metrics for your function app, use Memory working set (take its maximum for the peak) and Average memory working set, split by instance. Microsoft documents both for Flex Consumption, and lists them, along with Private Bytes, for function apps in general (not on the legacy Linux Consumption plan). Enter the values under Manual values.
Per-instance samples with units (412 MiB), or Prometheus output from a container-hosted app, can be pasted here instead.
Enter observed per-instance usage directly, in MiB.
02 Workload profile
Advanced: margins and defaults
Values the result relies on that are our own defaults, or vendor defaults your setup may change. Each “?” says how one moves the result; the guide says where it comes from.
03 Sizing gauge
04 Azure CLI command
—
05 How this was derived
How every number is calculated, with sources and assumptions (opens in a new tab) ↗
Result looks wrong? Report it
Instance sizes in short
Azure Functions doesn't take a free-form memory value. Flex Consumption, the recommended serverless plan, offers three instance sizes: 512 MB (0.25 cores), 2,048 MB (1 core) and 4,096 MB (2 cores). Azure docs
Running out of memory recycles the instance, so only the peak sets the size; the margin is MemoryLimit's own default and can be changed under Advanced. The calculator never goes below Microsoft's suggested 2,048 MB unless you lower the minimum there, and above 4,096 MB it points to Elastic Premium.
Executions on an instance share its memory, so the measured peak includes the concurrency the app ran at. Raising concurrency, or moving to a size with a higher default, can need more memory per instance. Azure docs
Common input mistakes
- Using the average working set as the peak: take the highest per-instance working set over a representative period.
- Changing concurrency after taking the samples: size again once it has changed.
- Sizing a Premium app on its own when other apps share the plan: add up the peaks of every app in the plan.
Full derivation, warnings and every assumption: how the Azure Functions calculator works. The shared formula and margin tables: the sizing model.
Related calculators: