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/iot-operations/manage-mqtt-broker/howto-configure-availability-scale.md
+78-9Lines changed: 78 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: sethmanheim
5
5
ms.author: sethm
6
6
ms.topic: how-to
7
7
ms.subservice: azure-mqtt-broker
8
-
ms.date: 05/14/2025
8
+
ms.date: 02/20/2026
9
9
ms.service: azure-iot-operations
10
10
11
11
# CustomerIntent: As an operator, I want to understand the settings for the MQTT broker so that I can configure it for high availability and scale.
@@ -251,14 +251,69 @@ In comparison, the *Tiny* memory profile has a frontend memory usage of 99 MiB a
251
251
252
252
## Cardinality and Kubernetes resource limits
253
253
254
-
To prevent resource starvation in the cluster, the broker is configured by default to [request Kubernetes CPU resource limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). Scaling the number of replicas or workers proportionally increases the CPU resources required. A deployment error is emitted if there are insufficient CPU resources available in the cluster. This notification helps you avoid situations where the requested broker cardinality lacks enough resources to run optimally. It also helps to avoid potential CPU contention and pod evictions.
254
+
To prevent resource starvation in the cluster, the broker can be configured to [request Kubernetes CPU resource limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) based on the cardinality settings. When enabled, scaling the number of replicas or workers proportionally increases the CPU resources required. A deployment error is emitted if there are insufficient CPU resources available in the cluster. This notification helps you avoid situations where the requested broker cardinality lacks enough resources to run optimally. It also helps to avoid potential CPU contention and pod evictions.
255
255
256
-
The MQTT broker currently requests one (1.0) CPU unit per frontend worker and two (2.0) CPU units per backend worker. For more information, see [Kubernetes CPU resource units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu).
256
+
> [!IMPORTANT]
257
+
> The default value for `generateResourceLimits.cpu` depends on the deployment method:
258
+
>
259
+
> -**Azure CLI (`az iot ops create`)**: `Disabled` by default. The CLI actively sets this value to `Disabled` to avoid deployment failures on resource-constrained clusters, particularly single-node clusters where the CPU requests can exceed available resources.
260
+
> -**REST API, Bicep, and ARM templates**: `Enabled` by default, as defined in the [Broker API specification](/rest/api/iotoperations/broker/create-or-update). If you deploy using these methods without explicitly setting `generateResourceLimits.cpu`, CPU resource limits are applied automatically.
261
+
>
262
+
> If you enable CPU resource limits, make sure your cluster has enough CPU resources to satisfy the broker's requests based on your cardinality configuration. See the CPU requirements below.
263
+
264
+
### Calculate CPU requirements
265
+
266
+
The MQTT broker requests CPU resources per pod based on the number of workers configured:
267
+
268
+
-**Frontend pods**: 1.0 CPU per worker
269
+
-**Backend pods**: 2.0 CPU per worker
270
+
271
+
Use the following formulas to calculate total CPU requirements:
272
+
273
+
| Component | Formula |
274
+
|-----------|---------|
275
+
| Frontend CPU |`replicas`×`frontend.workers`× 1.0 CPU |
276
+
| Backend CPU |`partitions`×`redundancyFactor`×`backend.workers`× 2.0 CPU |
277
+
|**Total broker CPU**| Frontend CPU + Backend CPU |
278
+
279
+
For more information, see [Kubernetes CPU resource units](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu).
280
+
281
+
> [!CAUTION]
282
+
> The broker isn't the only component that consumes CPU on the cluster. Other Azure IoT Operations components (such as the dataflow engine, OPC UA connector, and system pods) also reserve CPU resources, typically around 200-300m in aggregate. When planning cluster capacity, make sure to account for this overhead on top of the broker's CPU requirements. If the total CPU requested by all pods exceeds the available CPU on your cluster, broker pods get stuck in a `Pending` state.
283
+
284
+
#### Example: small cluster
285
+
286
+
Consider a 2-node cluster with 4 CPU cores per node (8 cores total) with the following cardinality:
Even though the cluster has 8 cores total, this deployment fails because other Azure IoT Operations components also consume CPU (~280m). The broker pods get stuck in `Pending` state with `Insufficient cpu` errors.
311
+
312
+
To resolve this, either add more nodes, increase cores per node, or reduce the broker cardinality.
257
313
258
-
For example, the following cardinality would request the following CPU resources:
314
+
#### Example: larger deployment
259
315
260
-
-**For frontends**: 2 CPU units per frontend pod, totaling 6 CPU units.
261
-
-**For backends**: 4 CPU units per backend pod (for two backend workers), times 2 (redundancy factor), times 3 (number of partitions), totaling 24 CPU units.
316
+
The following cardinality requests significantly more CPU resources:
262
317
263
318
```json
264
319
{
@@ -276,15 +331,29 @@ For example, the following cardinality would request the following CPU resources
276
331
}
277
332
```
278
333
279
-
To disable this setting, set the `generateResourceLimits.cpu` field to `Disabled` in the Broker resource.
To change this setting, set the `generateResourceLimits.cpu` field to `Enabled` or `Disabled` in the Broker resource.
280
339
281
340
# [Portal](#tab/portal)
282
341
283
-
Changing the `generateResourceLimits` field isn't supported in the Azure portal. To disable this setting, use the Azure CLI.
342
+
Changing the `generateResourceLimits` field isn't supported in the Azure portal. To change this setting, use the Azure CLI.
284
343
285
344
# [Azure CLI](#tab/azure-cli)
286
345
287
-
Prepare a Broker configuration file in JSON format, which includes the desired properties of the [Resource Manager `microsoft.iotoperations/instances/brokers` resource](/rest/api/iotoperations/broker/create-or-update), and set the `generateResourceLimits.cpu` field to `Disabled`. For example:
346
+
Prepare a Broker configuration file in JSON format, which includes the desired properties of the [Resource Manager `microsoft.iotoperations/instances/brokers` resource](/rest/api/iotoperations/broker/create-or-update), and set the `generateResourceLimits.cpu` field. For example, to enable CPU resource limits:
0 commit comments