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
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ Target-based scaling introduces faster scaling, and uses defaults for _target ex
86
86
87
87
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`.
88
88
89
-
|| IsBatched | IsSessionsEnabled |Concurrency Setting Used for target-based scaling|
89
+
|Execution Model| IsBatched | IsSessionsEnabled | Setting Used for _target executions per instance_|
@@ -97,7 +97,7 @@ The Service Bus extension support three execution models, determined by the `IsB
97
97
98
98
99
99
#### Single Dispatch Processing
100
-
In this model, each invocation of your function processes a single message. The `maxConcurrentCalls` setting governs concurrency.
100
+
In this model, each invocation of your function processes a single message. The `maxConcurrentCalls` setting governs _target executions per instance_.
101
101
102
102
For **v5.x+** of the Service Bus extension, modify the `host.json` setting `maxConcurrentCalls`:
103
103
```json
@@ -126,7 +126,8 @@ For Functions host **v2.x+**, modify the `host.json` setting `maxConcurrentCalls
126
126
```
127
127
#### Single Dispatch Processing (Session Based)
128
128
In this model, each invocation of your function processes a single message. However, depending on the number of active sessions for your Service Bus topic or queue, each instance leases one or more sessions.
129
-
For **v5.x+** of the Service Bus extension, modify the `host.json` setting `maxConcurrentSessions`:
129
+
130
+
For **v5.x+** of the Service Bus extension, modify the `host.json` setting `maxConcurrentSessions` to set _target executions per instance_:
130
131
```json
131
132
{
132
133
"version": "2.0",
@@ -137,7 +138,7 @@ For **v5.x+** of the Service Bus extension, modify the `host.json` setting `maxC
137
138
}
138
139
}
139
140
```
140
-
For Functions host **v2.x+**, modify the `host.json` setting `maxConcurrentSessions` in `sessionHandlerOptions`:
141
+
For Functions host **v2.x+**, modify the `host.json` setting `maxConcurrentSessions` in `sessionHandlerOptions` to set _target executions per instance_:
141
142
```json
142
143
{
143
144
"version": "2.0",
@@ -153,7 +154,7 @@ For Functions host **v2.x+**, modify the `host.json` setting `maxConcurrentSessi
153
154
#### Batch Processing
154
155
In this model, each invocation of your function processes a batch of messages.
155
156
156
-
For **v5.x+** of the Service Bus extension, modify the `host.json` setting `maxMessageBatchSize`:
157
+
For **v5.x+** of the Service Bus extension, modify the `host.json` setting `maxMessageBatchSize` to set _target executions per instance_:
157
158
```json
158
159
{
159
160
"version": "2.0",
@@ -164,7 +165,7 @@ For **v5.x+** of the Service Bus extension, modify the `host.json` setting `maxM
164
165
}
165
166
}
166
167
```
167
-
For Functions host **v2.x+**, modify the `host.json` setting `maxMessageCount` in `batchOptions`:
168
+
For Functions host **v2.x+**, modify the `host.json` setting `maxMessageCount` in `batchOptions` to set _target executions per instance_:
168
169
```json
169
170
{
170
171
"version": "2.0",
@@ -179,12 +180,12 @@ For Functions host **v2.x+**, modify the `host.json` setting `maxMessageCount` i
179
180
```
180
181
181
182
### Event Hubs
182
-
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 overrides 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.
183
+
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 for _target executions per instance_are `maxEventBatchSize` and `maxBatchSize`. However, if you wish to fine-tune target-based scaling, you can define a separate parameter `targetUnprocessedEventThreshold` that overrides to set _target executions per instance_ 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.
183
184
184
185
> [!NOTE]
185
186
> 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.
186
187
187
-
For **v5.x+** of the Event Hubs extension, modify the `host.json` setting `maxEventBatchSize`:
188
+
For **v5.x+** of the Event Hubs extension, modify the `host.json` setting `maxEventBatchSize` to set _target executions per instance_:
188
189
```json
189
190
{
190
191
"version": "2.0",
@@ -196,7 +197,7 @@ For **v5.x+** of the Event Hubs extension, modify the `host.json` setting `maxEv
196
197
}
197
198
```
198
199
199
-
For **v3.x+** of the Event Hubs extension, modify the `host.json` setting `maxBatchSize` under `eventProcessorOptions`:
200
+
For **v3.x+** of the Event Hubs extension, modify the `host.json` setting `maxBatchSize` under `eventProcessorOptions` to set _target executions per instance_:
200
201
```json
201
202
{
202
203
"version": "2.0",
@@ -210,7 +211,7 @@ For **v3.x+** of the Event Hubs extension, modify the `host.json` setting `maxBa
210
211
}
211
212
```
212
213
213
-
If defined, `targetUnprocessedEventThreshold` in `host.json` will be used as the target value instead of `maxBatchSize` or `maxEventBatchSize`:
214
+
If defined, `targetUnprocessedEventThreshold` in `host.json` will be used as _target executions per instance_ instead of `maxBatchSize` or `maxEventBatchSize`:
214
215
```json
215
216
{
216
217
"version": "2.0",
@@ -223,7 +224,7 @@ If defined, `targetUnprocessedEventThreshold` in `host.json` will be used as the
223
224
```
224
225
225
226
### Storage Queues
226
-
For **v2.x**+ of the Storage extension, modify the `host.json` setting `batchSize`:
227
+
For **v2.x**+ of the Storage extension, modify the `host.json` setting `batchSize` to set _target executions per instance_:
227
228
```json
228
229
{
229
230
"version": "2.0",
@@ -237,7 +238,7 @@ For **v2.x**+ of the Storage extension, modify the `host.json` setting `batchSiz
237
238
238
239
### Cosmos DB
239
240
240
-
Cosmos DB uses a function-level attribute, `MaxItemsPerInvocation`. Modify this in `function.json`, or directly in the trigger definition:
241
+
Cosmos DB uses a function-level attribute, `MaxItemsPerInvocation`. Modify this in `function.json`, or directly in the trigger definition, to set _target executions per instance_:
0 commit comments