You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-target-based-scaling.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Target Based Scaling provides a fast and intuitive scaling model for customers a
15
15
- Event Hubs
16
16
- Cosmos DB
17
17
18
-
It replaces the previous incremental scaling model as the default for these extension types. Incremental scaling allowed a maximum of 1 worker to be added or removed at [each new instance rate](event-driven-scaling.md#understanding-scaling-behaviors) and used more complicated heuristics for deciding when to scale out and scale in, so scaling was much less reactive. In contrast, Target Based Scaling allows simultaneous scale out of up to 4 instances and the total number of instances the function app will try to scale to is the length of your event source divided by the target number of executions per instance:
18
+
Target Based Scaling replaces the previous incremental scaling model as the default for these extension types. Incremental scaling added or removed a maximum of 1 worker at [each new instance rate](event-driven-scaling.md#understanding-scaling-behaviors), with complex decisions for when to scale out and scale in. In contrast, Target Based Scaling allows scale up of 4 instances at a time, and the scaling decision is based on a simple target based equation:
| Service Bus (Extension v5.x+, Single Dispatch) | extensions.serviceBus.maxConcurrentCalls | 16 |
36
36
| Service Bus (Extension v5.x+, Single Dispatch Sessions Based) | extensions.serviceBus.maxConcurrentSessions | 8 |
@@ -54,7 +54,7 @@ The following section explains how to configure the target for each of the suppo
54
54
## Details per Extension
55
55
### Service Bus Queues and Topics
56
56
57
-
The Service Bus extension support three execution models, which are determined by the `IsBatched` and `IsSessionsEnabled` attributes of your Service Bus trigger. The default value for `IsBatched` and `IsSessionsEnabled` is `false`, which means your Service Bus trigger is using Single Dispatch Processing if you haven't done any additional configuration.
57
+
The Service Bus extension support three execution models, determined by the `IsBatched` and `IsSessionsEnabled` attributes of your Service Bus trigger. The default value for `IsBatched` and `IsSessionsEnabled` is `false`.
58
58
59
59
|| IsBatched | IsSessionsEnabled | Concurrency Setting Used for Target Based Scaling |
@@ -67,7 +67,7 @@ The Service Bus extension support three execution models, which are determined b
67
67
68
68
69
69
#### Single Dispatch Processing
70
-
In this model, each invocation of your function processes a single message. Concurrency is governed by the `maxConcurrentCalls` setting.
70
+
In this model, each invocation of your function processes a single message. The `maxConcurrentCalls` setting governs concurrency.
71
71
72
72
For **v5.x+** of the Service Bus extension, modify the `host.json` setting `maxConcurrentCalls`:
73
73
```json
@@ -149,7 +149,7 @@ For Functions host **v2.x+**, modify the `host.json` setting `maxMessageCount` i
149
149
```
150
150
151
151
### Event Hubs
152
-
For Event Hubs, Azure Functions scales based on the number of unprocessed events distributed across all the partitions in the hub. By default, the `host.json` attributes used are `maxEventBatchSize` and `maxBatchSize`. However, if you wish to fine-tune target based scaling, you can define a separate parameter `targetUnprocessedEventThreshold`. This will override the target value. If `targetUnprocessedEventThreshold` is set, the total unprocessed event count will be divided by this value to determine the number of instances, which will then be rounded up to a worker instance count that creates a balanced partition distribution.
152
+
For Event Hubs, Azure Functions scales based on the number of unprocessed events distributed across all the partitions in the hub. By default, the `host.json` attributes used are `maxEventBatchSize` and `maxBatchSize`. However, if you wish to fine-tune target based scaling, you can define a separate parameter `targetUnprocessedEventThreshold` that override the target value without changing the batch settings. If `targetUnprocessedEventThreshold` is set, the total unprocessed event count is divided by this value to determine the number of instances, which is then be rounded up to a worker instance count that creates a balanced partition distribution.
153
153
154
154
> [!NOTE]
155
155
> Since Event Hubs is a partitioned workload, the target instance count for Event Hubs is capped by the number of partitions in your Event Hub.
@@ -207,7 +207,7 @@ For **v2.x**+ of the Storage extension, modify the `host.json` setting `batchSiz
207
207
208
208
### Cosmos DB
209
209
210
-
Cosmos DB uses a function-level attribute, `MaxItemsPerInvocation`. You can modify this in the`function.json`, or directly in the trigger definition:
210
+
Cosmos DB uses a function-level attribute, `MaxItemsPerInvocation`. Modify this in `function.json`, or directly in the trigger definition:
211
211
```C#
212
212
namespaceCosmosDBSamplesV2
213
213
{
@@ -256,14 +256,14 @@ Sample `bindings` section of a `function.json` with `MaxItemsPerInvocation` defi
256
256
> Since Cosmos DB is a partitioned workload, the target instance count for Cosmos DB is capped by the number of physical partitions in your Cosmos DB. For further documentation on Cosmos DB scaling, please see notes on [physical partitions](../cosmos-db/nosql/change-feed-processor.md#dynamic-scaling) and [lease ownership](../cosmos-db/nosql/change-feed-processor.md#dynamic-scaling).
257
257
258
258
## Opting Out
259
-
Target Based Scaling is an opt-out feature except for function apps on the the Premium plan with Runtime Scale Monitoring enabled. This means it is on by default for the Functions Consumption plan, and Premium plans without Runtime Scale Monitoring. If you wish to disable Target Based Scaling and revert to incremental scaling, add the following app setting to your function app:
259
+
Target Based Scaling is an opt-out feature except for function apps on the the Premium plan with Runtime Scale Monitoring enabled. It is on by default for apps on the Consumption plan or Premium plans without Runtime Scale Monitoring. If you wish to disable Target Based Scaling and revert to incremental scaling, add the following app setting to your function app:
260
260
261
261
| App Setting | Value |
262
262
| ----------------------------- | ----- |
263
263
|`TARGET_BASED_SCALING_ENABLED`| 0 |
264
264
265
265
## Premium Plans with Runtime Scale Monitoring Enabled
266
-
In [Runtime Scale Monitoring](functions-networking-options.md?tabs=azure-cli#premium-plan-with-virtual-network-triggers), Target Based Scaling is handled by the extensions. Hence, in addition to the function app runtime requirement above, your extension packages must meet the following requirements:
266
+
In [Runtime Scale Monitoring](functions-networking-options.md?tabs=azure-cli#premium-plan-with-virtual-network-triggers), the extensions handle Target Based Scaling. Hence, in addition to the function app runtime version requirement, your extension packages must meet the following minimum versions:
267
267
268
268
| Extension Name | Minimum Version Needed |
269
269
| -------------- | ---------------------- |
@@ -279,4 +279,4 @@ Additionally, Target Based Scaling is currently an **opt-in** feature for this c
279
279
|`TARGET_BASED_SCALING_ENABLED`| 1 |
280
280
281
281
## Dynamic Concurrency Support
282
-
Target Based Scaling introduces faster scale out and in, and uses defaults for the targets. When using Service Bus or Storage queues with Target Based Scaling, you have the option of enabling [Dynamic Concurrency](functions-concurrency.md#dynamic-concurrency). In this configuration, the target metric will be determined automatically by Dynamic Concurrency feature over time, instead of the `host.json` and function attributes defined above.
282
+
Target Based Scaling introduces faster scale out and in, and uses defaults for the targets. When using Service Bus or Storage queues with Target Based Scaling, you have the option of enabling [Dynamic Concurrency](functions-concurrency.md#dynamic-concurrency). In this configuration, the target metric is determined automatically by Dynamic Concurrency feature over time, instead of the `host.json` and function attributes.
0 commit comments