Skip to content

Commit a339335

Browse files
authored
Merge pull request #286415 from nzthiago/main
Clarifying functions timeout duration and adding Flex Consumption specifics
2 parents 54d9381 + a34dda4 commit a339335

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

articles/azure-functions/event-driven-scaling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ $resource | Set-AzResource -Force
9595

9696
## Scale-in behaviors
9797

98-
Event-driven scaling automatically reduces capacity when demand for your functions is reduced. It does this by draining instances of their current function executions and then removes those instances. This behavior is logged as drain mode. The grace period for functions that are currently executing can extend up to 10 minutes for Consumption plan apps and up to 60 minutes for Premium plan apps. Event-driven scaling and this behavior don't apply to Dedicated plan apps.
98+
Event-driven scaling automatically reduces capacity when demand for your functions is reduced. It does this by draining instances of their current function executions and then removes those instances. This behavior is logged as drain mode. The grace period for functions that are currently executing can extend up to 10 minutes for Consumption plan apps and up to 60 minutes for Flex Consumption and Premium plan apps. Event-driven scaling and this behavior don't apply to Dedicated plan apps.
9999

100100
The following considerations apply for scale-in behaviors:
101101

articles/azure-functions/functions-premium-plan.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ To learn more about how scaling works, see [Event-driven scaling in Azure Functi
145145

146146
Functions in a Consumption plan are limited to 10 minutes for a single execution. In the Premium plan, the run duration defaults to 30 minutes to prevent runaway executions. However, you can [modify the host.json configuration](./functions-host-json.md#functiontimeout) to make the duration unbounded for Premium plan apps, with the following limitations:
147147

148-
+ Platform upgrades can trigger a managed shutdown and halt the function execution.
149-
+ Platform outages can cause an unhandled shutdown and halt the function execution.
148+
+ Platform upgrades can trigger a managed shutdown and halt the function execution with a grace period of 10 minutes.
150149
+ There's an idle timer that stops the worker after 60 minutes with no new executions.
151150
+ [Scale-in behavior](event-driven-scaling.md#scale-in-behaviors) can cause worker shutdown after 60 minutes.
152151
+ [Slot swaps](functions-deployment-slots.md) can terminate executions on the source and target slots during the swap.

includes/functions-limits.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ ms.author: glenga
99
---
1010
| Resource |[Consumption plan](/azure/azure-functions/consumption-plan)|[Flex Consumption plan](/azure/azure-functions/flex-consumption-plan)<sup>13</sup>|[Premium plan](/azure/azure-functions/functions-premium-plan)|[Dedicated plan](/azure/azure-functions/dedicated-plan)/[ASE](/azure/app-service/environment/intro)| [Container Apps](/azure/azure-functions/functions-container-apps-hosting)|
1111
| --- | --- | --- | --- | --- | --- |
12-
| Default [timeout duration](/azure/azure-functions/functions-scale#timeout) (min) |5 | 30 | 30 |30<sup>1</sup> | 30<sup>17</sup> |
13-
| Max [timeout duration](/azure/azure-functions/functions-scale#timeout) (min) |10 | unbounded<sup>16</sup> | unbounded<sup>8</sup> | unbounded<sup>2</sup> | unbounded<sup>18</sup> |
12+
| Default [timeout duration](/azure/azure-functions/functions-scale#timeout) (min) |5 | 30 | 30 |30<sup>1</sup> | 30<sup>16</sup> |
13+
| Max [timeout duration](/azure/azure-functions/functions-scale#timeout) (min) |10 | unbounded<sup>8</sup> | unbounded<sup>8</sup> | unbounded<sup>2</sup> | unbounded<sup>17</sup> |
1414
| Max outbound connections (per instance) | 600 active (1200 total) | unbounded | unbounded | unbounded | unbounded |
1515
| Max request size (MB)<sup>3</sup> | 100 | 100 | 100 | 100 | 100 |
1616
| Max query string length<sup>3</sup> | 4096 | 4096 | 4096 | 4096 | 4096 |
1717
| Max request URL length<sup>3</sup> | 8192 | 8192 | 8192 | 8192 | 8192 |
1818
|[ACU](/azure/virtual-machines/acu) per instance | 100 | varies | 210-840 | 100-840/210-250<sup>9</sup> | [varies](/azure/container-apps/billing) |
1919
| Max memory (GB per instance) | 1.5 | 4<sup>14</sup> | 3.5-14 | 1.75-14/3.5-14 | [varies](/azure/container-apps/billing) |
20-
| Max instance count (Windows/Linux) | 200/100 | 1000 <sup>15</sup> | 100/20 | varies by SKU/100<sup>10</sup> | 10-300<sup>19</sup> |
20+
| Max instance count (Windows/Linux) | 200/100 | 1000 <sup>15</sup> | 100/20 | varies by SKU/100<sup>10</sup> | 10-300<sup>18</sup> |
2121
| Function apps per plan<sup>12</sup> | 100 | 100 | 100 | unbounded<sup>4</sup> | unbounded<sup>4</sup> |
2222
| [App Service plans](/azure/app-service/overview-hosting-plans) | 100 per [region](https://azure.microsoft.com/global-infrastructure/regions/) | n/a | 100 per resource group |100 per resource group | n/a |
2323
| [Deployment slots](/azure/azure-functions/functions-deployment-slots) per app<sup>11</sup> | 2 | n/a | 3 | 1-20<sup>10</sup> | not supported |
@@ -29,21 +29,20 @@ ms.author: glenga
2929
Notes on service limits:
3030

3131
1. By default, the timeout for the Functions 1.x runtime in an App Service plan is unbounded.
32-
2. Requires the App Service plan be set to [Always On](/azure/azure-functions/dedicated-plan#always-on). Pay at standard [rates](https://azure.microsoft.com/pricing/details/app-service/).
32+
2. Requires the App Service plan be set to [Always On](/azure/azure-functions/dedicated-plan#always-on). Pay at standard [rates](https://azure.microsoft.com/pricing/details/app-service/). A grace period of 10 minutes is given during platform updates.
3333
3. These limits are [set in the host](https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/web.config).
3434
4. The actual number of function apps that you can host depends on the activity of the apps, the size of the machine instances, and the corresponding resource utilization.
3535
5. The storage limit is the total content size in temporary storage across all apps in the same App Service plan. For Consumption plans on Linux, the storage is currently 1.5 GB.
3636
6. Consumption plan uses an Azure Files share for persisted storage. When you provide your own Azure Files share, the specific share size limits depend on the storage account you set for [WEBSITE_CONTENTAZUREFILECONNECTIONSTRING](/azure/azure-functions/functions-app-settings#website_contentazurefileconnectionstring). On Linux, you must [explicitly mount your own Azure Files share](/azure/azure-functions/storage-considerations#mount-file-shares) for both Flex Consumption and Consumption plans.
3737
7. When your function app is hosted in a [Consumption plan](/azure/azure-functions/consumption-plan), only the CNAME option is supported. For function apps in a [Premium plan](/azure/azure-functions/functions-premium-plan) or an [App Service plan](/azure/azure-functions/dedicated-plan), you can map a custom domain using either a CNAME or an A record.
38-
8. Guaranteed for up to 60 minutes.
38+
8. There is no maximum execution timeout duration enforced. However, the grace period given to a function execution is 60 minutes [during scale in](../articles/azure-functions/event-driven-scaling.md#scale-in-behaviors) and 10 minutes during platform updates.
3939
9. Workers are roles that host customer apps. Workers are available in three fixed sizes: One vCPU/3.5 GB RAM; Two vCPU/7 GB RAM; Four vCPU/14 GB RAM.
4040
10. See [App Service limits](/azure/azure-resource-manager/management/azure-subscription-service-limits#app-service-limits) for details.
4141
11. Including the production slot.
4242
12. There's currently a limit of 5000 function apps in a given subscription.
4343
13. The Flex Consumption plan is currently in preview.
4444
14. Flex Consumption plan instance sizes are currently defined as either 2,048 MB or 4,096 MB. For more information, see [Instance memory](/azure/azure-functions/flex-consumption-plan#instance-memory).
4545
15. Flex Consumption plan during preview has a regional subscription quota that limits the total memory usage of all instances across a given region. For more information, see [Instance memory](/azure/azure-functions/flex-consumption-plan#instance-memory).
46-
16. In a Flex Consumption plan, the host doesn't enforce an execution time limit. However, there are currently no guarantees because the platform might need to terminate your instances during scale-in, deployments, or to apply updates.
47-
17. When the [minimum number of replicas](/azure/container-apps/scale-app#scale-definition) is set to zero, the default timeout depends on the specific triggers used in the app.
48-
18. When the [minimum number of replicas](../articles/container-apps/scale-app.md#scale-definition) is set to one or more.
49-
19. On Container Apps, you can set the [maximum number of replicas](/azure/container-apps/scale-app#scale-definition), which is honored as long as there's enough cores quota available.
46+
16. When the [minimum number of replicas](/azure/container-apps/scale-app#scale-definition) is set to zero, the default timeout depends on the specific triggers used in the app.
47+
17. When the [minimum number of replicas](../articles/container-apps/scale-app.md#scale-definition) is set to one or more.
48+
18. On Container Apps, you can set the [maximum number of replicas](/azure/container-apps/scale-app#scale-definition), which is honored as long as there's enough cores quota available.

includes/functions-timeout-duration.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ ms.author: glenga
99
---
1010
## <a name="timeout"></a>Function app timeout duration
1111

12-
The timeout duration for functions in a function app is defined by the `functionTimeout` property in the [host.json](../articles/azure-functions/functions-host-json.md#functiontimeout) project file. This property applies specifically to function executions. After the trigger starts function execution, the function needs to return/respond within the timeout duration. For more information, see [Improve Azure Functions performance and reliability](../articles/azure-functions/performance-reliability.md#make-sure-background-tasks-complete).
12+
The timeout duration for functions in a function app is defined by the `functionTimeout` property in the [host.json](../articles/azure-functions/functions-host-json.md#functiontimeout) project file. This property applies specifically to function executions. After the trigger starts function execution, the function needs to return/respond within the timeout duration. To avoid timeouts, it's important to [write robust functions](../articles/azure-functions/functions-best-practices.md#write-robust-functions). For more information, see [Improve Azure Functions performance and reliability](../articles/azure-functions/performance-reliability.md#make-sure-background-tasks-complete).
1313

1414
The following table shows the default and maximum values (in minutes) for specific plans:
1515

1616
| Plan | Default | Maximum<sup>1</sup> |
1717
|------|---------|---------|
1818
| **[Consumption plan](../articles/azure-functions/consumption-plan.md)** | 5 | 10 |
19-
| **[Flex Consumption plan](../articles/azure-functions/flex-consumption-plan.md)** | 30 | Unlimited<sup>3</sup> |
20-
| **[Premium plan](../articles/azure-functions/functions-premium-plan.md)** | 30<sup>2</sup> | Unlimited<sup>3</sup> |
21-
| **[Dedicated plan](../articles/azure-functions/dedicated-plan.md)** | 30<sup>2</sup> | Unlimited<sup>3</sup> |
22-
| **[Container Apps](../articles/azure-functions/functions-container-apps-hosting.md)** | 30<sup>5</sup> | Unlimited<sup>3</sup> |
19+
| **[Flex Consumption plan](../articles/azure-functions/flex-consumption-plan.md)** | 30 | Unbounded<sup>2</sup> |
20+
| **[Premium plan](../articles/azure-functions/functions-premium-plan.md)** | 30<sup>4</sup> | Unbounded<sup>2</sup> |
21+
| **[Dedicated plan](../articles/azure-functions/dedicated-plan.md)** | 30<sup>4</sup> | Unbounded<sup>3</sup> |
22+
| **[Container Apps](../articles/azure-functions/functions-container-apps-hosting.md)** | 30 | Unbounded<sup>4</sup> |
2323

24-
1. Regardless of the function app timeout setting, 230 seconds is the maximum amount of time that an HTTP triggered function can take to respond to a request. This is because of the [default idle timeout of Azure Load Balancer](../articles/app-service/faq-availability-performance-application-issues.yml#why-does-my-request-time-out-after-230-seconds-). For longer processing times, consider using the [Durable Functions async pattern](../articles/azure-functions/durable/durable-functions-overview.md#async-http) or [defer the actual work and return an immediate response](../articles/azure-functions/performance-reliability.md#avoid-long-running-functions).
25-
2. The default timeout for version 1.x of the Functions runtime is _unlimited_.
26-
3. Guaranteed for up to 60 minutes. [OS and runtime patching](../articles/app-service/overview-patch-os-runtime.md), vulnerability patching, and [scale in behaviors](../articles/azure-functions/event-driven-scaling.md#scale-in-behaviors) can still cancel function executions so [ensure to write robust functions](../articles/azure-functions/functions-best-practices.md#write-robust-functions).
27-
4. In a Flex Consumption plan, the host doesn't enforce an execution time limit. However, there are currently no guarantees because the platform might need to terminate your instances during scale-in, deployments, or to apply updates.
24+
1. Regardless of the function app timeout setting, 230 seconds is the maximum amount of time that an HTTP triggered function can take to respond to a request. This is because of the [default idle timeout of Azure Load Balancer](../articles/app-service/faq-availability-performance-application-issues.yml#why-does-my-request-time-out-after-230-seconds-). For longer processing times, consider using the [Durable Functions async pattern](../articles/azure-functions/durable/durable-functions-overview.md#async-http) or [defer the actual work and return an immediate response](../articles/azure-functions/performance-reliability.md#avoid-long-running-functions).
25+
2. There is no maximum execution timeout duration enforced. However, the grace period given to a function execution is 60 minutes [during scale in](../articles/azure-functions/event-driven-scaling.md#scale-in-behaviors) for the Flex Consumption and Premium plans, and a grace period of 10 minutes is given during platform updates.
26+
3. Requires the App Service plan be set to [Always On](/azure/azure-functions/dedicated-plan#always-on). A grace period of 10 minutes is given during platform updates.
27+
4. The default timeout for version 1.x of the Functions host runtime is _unbounded_.
2828
5. When the [minimum number of replicas](../articles/container-apps/scale-app.md#scale-definition) is set to zero, the default timeout depends on the specific triggers used in the app.

0 commit comments

Comments
 (0)