Skip to content

Commit 5d1e91d

Browse files
committed
updates to control plane service limits.
1 parent f44b480 commit 5d1e91d

File tree

7 files changed

+65
-31
lines changed

7 files changed

+65
-31
lines changed

articles/cosmos-db/concepts-limits.md

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.author: sidandrews
77
ms.reviewer: mjbrown
88
ms.service: cosmos-db
99
ms.topic: conceptual
10-
ms.date: 02/27/2023
10+
ms.date: 04/15/2023
1111
ms.custom: ignite-2022
1212
---
1313

@@ -93,18 +93,46 @@ Depending on the current RU/s provisioned and resource settings, each resource c
9393

9494
¹ Serverless containers up to 1 TB are currently in preview with Azure Cosmos DB. To try the new feature, register the *"Azure Cosmos DB Serverless 1 TB Container Preview"* [preview feature in your Azure subscription](../azure-resource-manager/management/preview-features.md).
9595

96-
## Control plane operations
96+
## Control plane
9797

98-
You can [create and manage your Azure Cosmos DB account](how-to-manage-database-account.md) using the Azure portal, Azure PowerShell, Azure CLI, and Azure Resource Manager templates. The following table lists the limits per subscription, account, and number of operations.
98+
Azure Cosmos DB maintains a resource provider that offers a management layer to create, update, and delete resources in your Azure Cosmos DB account. The resource provider interfaces with the overall Azure Resource Management layer, which is the deployment and management service for Azure. You can [create and manage Azure Cosmos DB resources](how-to-manage-database-account.md) using the Azure portal, Azure PowerShell, Azure CLI, Azure Resource Manager and Bicep templates, Rest API, Azure Management SDKs as well as 3rd party tools such as Terraform and Pulumi.
99+
100+
This management layer can also be accessed from the Azure Cosmos DB data plane SDKs used in your applications to create and manage resources within an account. Data plane SDKs also make control plane requests during inital connection to the service to do things like enumerating databases and containers, as well as requesting account keys for authentication.
101+
102+
Each account for Azure Cosmos DB has a `master partition` which contains all of the metadata for an account. It also has a small amount of throughput to support control plane operations. Control plane requests that create, read, update or delete this metadata consumes this throughput. When the amount of throughput consumed by control plane operations exceeds this amount, operations are rate-limited, same as data plane operations within Azure Cosmos DB. However, unlike throughput for data operations, throughput for the master partition cannot be increased.
103+
104+
Some control plane operations do not consume master partition throughput, such as Get or List Keys. However, unlike requests on data within your Azure Cosmos DB account, resource providers within Azure are not designed for high request volumes. **Control plane operations that exceed the documented limits at sustained levels over consecutive 5-minute periods here may experience request throttling as well failed or incomplete operations on Azure Cosmos DB resources**.
105+
106+
Control plane operations can be monitored by navigating the the Insights tab for an Azure Cosmos DB account. To learn more see [Monitor Control Plane Requests](use-metrics.md#Monitor-control-plane-requests). Users can also customize these use Azure Monitor and create a workbook to monitor [Metadata Requests](monitor-reference.md#request-metrics) and set alerts on them.
107+
108+
### Resource limits
109+
110+
The following table lists resource limits per subscription or account.
99111

100112
| Resource | Limit |
101113
| --- | --- |
102114
| Maximum number of accounts per subscription | 50 by default. ¹ |
103-
| Maximum number of regional failovers | 10/hour by default. ¹ ² |
115+
| Maximum number of databases & containers per account | 500 ² |
116+
| Maximum throughput supported by an account for metadata operations | 240 RU/s |
104117

105118
¹ You can increase these limits by creating an [Azure Support request](create-support-request-quota-increase.md) up to 1,000 max.
119+
² This limit cannot be increased. Total count of both with an account. (1 database and 499 containers, 250 databases and 250 containers, etc.)
120+
121+
### Request limits
122+
123+
The following table lists request limits per 5 minute interval, per account, unless otherwise specified.
124+
125+
| Operation | Limit |
126+
| --- | --- |
127+
| Maximum List or Get Keys | 500 ¹ |
128+
| Maximum Create database & container | 500 |
129+
| Maximum Get or List database & container | 500 ¹ |
130+
| Maximum Update provisioned throughput | 25 |
131+
| Maximum regional failover | 10 (per hour) ² |
132+
| Maximum number of all operations (PUT, POST, PATCH, DELETE, GET) not defined above | 100 |
106133

107-
² Regional failovers only apply to single region writes accounts. Multi-region write accounts don't require or have any limits on changing the write region.
134+
¹ Users should use [singleton client](nosql/best-practice-dotnet.md#checklist) for SDK instances and cache keys and database and container references between requests for the lifetime of that instance.
135+
² Regional failovers only apply to single region writes accounts. Multi-region write accounts don't require or allow changing the write region.
108136

109137
Azure Cosmos DB automatically takes backups of your data at regular intervals. For details on backup retention intervals and windows, see [Online backup and on-demand data restore in Azure Cosmos DB](online-backup-and-restore.md).
110138

@@ -116,17 +144,15 @@ Here's a list of limits per account.
116144

117145
| Resource | Limit |
118146
| --- | --- |
119-
| Maximum number of databases per account | 500 |
120-
| Maximum number of containers per database with shared throughput |25 |
121-
| Maximum number of containers per account | 500 |
147+
| Maximum number of databases and containers per account | 500 |
148+
| Maximum number of containers per database with shared throughput | 25 |
122149
| Maximum number of regions | No limit (All Azure regions) |
123150

124151
### Serverless
125152

126153
| Resource | Limit |
127154
| --- | --- |
128-
| Maximum number of databases per account | 100 |
129-
| Maximum number of containers per account | 100 |
155+
| Maximum number of databases and containers per account | 100 |
130156
| Maximum number of regions | 1 (Any Azure region) |
131157

132158
## Per-container limits
@@ -178,6 +204,8 @@ Azure Cosmos DB supports [CRUD and query operations](/rest/api/cosmos-db/) again
178204
| Maximum response size (for example, paginated query) | 4 MB |
179205
| Maximum number of operations in a transactional batch | 100 |
180206

207+
Azure Cosmos DB supports execution of triggers during writes. The service supports a maximum of one pre-trigger and one post-trigger per write operation.
208+
181209
Once an operation like query reaches the execution timeout or response size limit, it returns a page of results and a continuation token to the client to resume execution. There's no practical limit on the duration a single query can run across pages/continuations.
182210

183211
Azure Cosmos DB uses HMAC for authorization. You can use either a primary key, or a [resource token](secure-access-to-data.md) for fine-grained access control to resources. These resources can include containers, partition keys, or items. The following table lists limits for authorization tokens in Azure Cosmos DB.
@@ -191,19 +219,6 @@ Azure Cosmos DB uses HMAC for authorization. You can use either a primary key, o
191219

192220
¹ You can increase it by [filing an Azure support ticket](create-support-request-quota-increase.md)
193221

194-
Azure Cosmos DB supports execution of triggers during writes. The service supports a maximum of one pre-trigger and one post-trigger per write operation.
195-
196-
## Metadata request limits
197-
198-
Azure Cosmos DB maintains system metadata for each account. This metadata allows you to enumerate collections, databases, other Azure Cosmos DB resources, and their configurations for free of charge.
199-
200-
| Resource | Limit |
201-
| --- | --- |
202-
|Maximum collection create rate per minute| 100|
203-
|Maximum Database create rate per minute| 100|
204-
|Maximum provisioned throughput update rate per minute| 5|
205-
|Maximum throughput supported by an account for metadata operations | 240 RU/s |
206-
207222
## Limits for autoscale provisioned throughput
208223

209224
See the [Autoscale](provision-throughput-autoscale.md#autoscale-limits) article and [FAQ](autoscale-faq.yml#lowering-the-max-ru-s) for more detailed explanation of the throughput and storage limits with autoscale.
@@ -241,13 +256,16 @@ The following table lists the limits specific to MongoDB feature support. Other
241256

242257
| Resource | Limit |
243258
| --- | --- |
259+
| Maximum size of a document | 16 MB (UTF-8 length of JSON representation) ¹ |
244260
| Maximum MongoDB query memory size (This limitation is only for 3.2 server version) | 40 MB |
245261
| Maximum execution time for MongoDB operations (for 3.2 server version)| 15 seconds|
246262
| Maximum execution time for MongoDB operations (for 3.6 and 4.0 server version)| 60 seconds|
247263
| Maximum level of nesting for embedded objects / arrays on index definitions | 6 |
248-
| Idle connection timeout for server side connection closure ¹ | 30 minutes |
264+
| Idle connection timeout for server side connection closure ² | 30 minutes |
265+
266+
¹ Large document sizes up to 16 MB require feature enablement in Azure Portal. Read the [feature documentation](../cosmos-db/mongodb/feature-support-42.md#data-types) to learn more.
249267

250-
¹ We recommend that client applications set the idle connection timeout in the driver settings to 2-3 minutes because the [default timeout for Azure LoadBalancer is 4 minutes](../load-balancer/load-balancer-tcp-idle-timeout.md). This timeout ensures that an intermediate load balancer idle doesn't close connections between the client machine and Azure Cosmos DB.
268+
² We recommend that client applications set the idle connection timeout in the driver settings to 2-3 minutes because the [default timeout for Azure LoadBalancer is 4 minutes](../load-balancer/load-balancer-tcp-idle-timeout.md). This timeout ensures that an intermediate load balancer idle doesn't close connections between the client machine and Azure Cosmos DB.
251269

252270
## Try Azure Cosmos DB Free limits
253271

articles/cosmos-db/how-to-manage-database-account.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: cosmos-db
66
ms.subservice: nosql
77
ms.custom: ignite-2022, devx-track-arm-template
88
ms.topic: how-to
9-
ms.date: 03/08/2023
9+
ms.date: 04/14/2023
1010
ms.author: sidandrews
1111
ms.reviewer: mjbrown
1212
---
@@ -15,10 +15,10 @@ ms.reviewer: mjbrown
1515

1616
[!INCLUDE[NoSQL, MongoDB, Cassandra, Gremlin, Table](includes/appliesto-nosql-mongodb-cassandra-gremlin-table.md)]
1717

18-
This article describes how to manage various tasks on an Azure Cosmos DB account by using the Azure portal.
18+
This article describes how to manage various tasks on an Azure Cosmos DB account by using the Azure portal. Azure Cosmos DB can also be managed with other Azure management clients including [Azure PowerShell](manage-with-powershell.md), [Azure CLI](nosql/manage-with-cli.md), [Azure Resource Manager templates](./manage-with-templates.md), [Bicep](nosql/manage-with-bicep.md), and [Terraform](nosql/samples-terraform.md).
1919

2020
> [!TIP]
21-
> Azure Cosmos DB can also be managed with other Azure management clients including [Azure PowerShell](manage-with-powershell.md), [Azure CLI](sql/manage-with-cli.md), [Azure Resource Manager templates](./manage-with-templates.md), and [Bicep](sql/manage-with-bicep.md).
21+
> The management API for Azure Cosmos DB or *control plane* is not designed for high request volumes like the rest of the service. To learn more see [Control Plane Service Limits](concepts-limits.md#control-plane)
2222
2323
## Create an account
2424

@@ -108,6 +108,7 @@ After an Azure Cosmos DB account is configured for service-managed failover, the
108108

109109
:::image type="content" source="./media/how-to-manage-database-account/manual-failover.png" alt-text="Screenshot of the manual failover portal menu.":::
110110

111+
111112
## Next steps
112113

113114
For more information and examples on how to manage the Azure Cosmos DB account as well as databases and containers, read the following articles:
16.6 KB
Loading
26 KB
Loading
103 KB
Loading

articles/cosmos-db/monitor-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.author: esarroyo
55
author: StefArroyo
66
ms.service: cosmos-db
77
ms.topic: how-to
8-
ms.date: 12/07/2020
8+
ms.date: 04/14/2023
99
ms.custom: subject-monitoring, ignite-2022
1010
---
1111

@@ -24,7 +24,7 @@ All the metrics corresponding to Azure Cosmos DB are stored in the namespace **A
2424
|Metric (Metric Display Name)|Unit (Aggregation Type) |Description|Dimensions| Time granularities| Legacy metric mapping | Usage |
2525
|---|---|---|---| ---| ---| ---|
2626
| TotalRequests (Total Requests) | Count (Count) | Number of requests made| DatabaseName, CollectionName, Region, StatusCode| All | TotalRequests, Http 2xx, Http 3xx, Http 400, Http 401, Internal Server error, Service Unavailable, Throttled Requests, Average Requests per Second | Used to monitor requests per status code, container at a minute granularity. To get average requests per second, use Count aggregation at minute and divide by 60. |
27-
| MetadataRequests (Metadata Requests) |Count (Count) | Count of metadata requests. Azure Cosmos DB maintains system metadata container for each account, that allows you to enumerate collections, databases, etc., and their configurations, free of charge. | DatabaseName, CollectionName, Region, StatusCode| All| |Used to monitor throttles due to metadata requests.|
27+
| MetadataRequests (Metadata Requests) |Count (Count) | Count of ARM metadata requests. Metadata has request limits. See [Control Plane Limits](concepts-limits.md#control-plane) for more information. | DatabaseName, CollectionName, Region, StatusCode| All | | Used to monitor metadata requests in scenarios where requests are being throttled. See [Monitor Control Plane Requests](use-metrics.md#Monitor-control-plane-requests) for more information. |
2828
| MongoRequests (Mongo Requests) | Count (Count) | Number of Mongo Requests Made | DatabaseName, CollectionName, Region, CommandName, ErrorCode| All |Mongo Query Request Rate, Mongo Update Request Rate, Mongo Delete Request Rate, Mongo Insert Request Rate, Mongo Count Request Rate| Used to monitor Mongo request errors, usages per command type. |
2929

3030
### Request Unit metrics

articles/cosmos-db/use-metrics.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.reviewer: mjbrown
77
ms.service: cosmos-db
88
ms.subservice: nosql
99
ms.topic: how-to
10-
ms.date: 03/13/2023
10+
ms.date: 04/14/2023
1111
ms.custom: devx-track-csharp, ignite-2022
1212
---
1313

@@ -108,6 +108,21 @@ IReadOnlyDictionary<string, QueryMetrics> metrics = result.QueryMetrics;
108108

109109
*QueryMetrics* provides details on how long each component of the query took to execute. The most common root cause for long running queries is scans, meaning the query was unable to apply the indexes. This problem can be resolved with a better filter condition.
110110

111+
## Monitor control plane requests
112+
113+
Azure Cosmos DB applies limits on the number of metadata requests that can be made over consecutive 5 minute intervals. Control plane requests which go over these limits may experience throttling. Metadata requests may in some cases, consume throughput against a `master partition` within an account that contains all of an account's metadata. Control plane requests which go over the throughput amount will experience rate limiting (429s).
114+
115+
To get started, head to the [Azure portal](https://portal.azure.com) and navigate to the **Insights** pane. From this pane, open the **System** tab. The System tab shows two charts. One that shows all metadata requests for an account. The second shows metadata requests throughput consumption from the account's `master partition` that stores an account's metadata.
116+
117+
:::image type="content" source="media/use-metrics/metadata-requests-by-status-code.png" alt-text="Screenshot of the Insights pane, highlighting the metadata requests graph on the System tab." lightbox="media/use-metrics/metadata-requests-by-status-code.png" :::
118+
119+
:::image type="content" source="media/use-metrics/metadata-requests-429.png" alt-text="Screenshot of the Insights pane, highlighting the metadata requests 429 graph on the System tab." lightbox="media/use-metrics/metadata-requests-429.png" :::
120+
121+
The Metadata Request by Status Code graph above aggregates requests at increasing larger granularity as you increase the Time Range. The largest Time Range you can use for a 5 minute time bin is 4 hours. To monitor metadata requests over a greater time range with specific granularity, use Azure Metrics. Create a new chart and select Metadata requests metric. In the upper right corner select 5 minutes for Time granularity as seen below. Metrics also allow for users to [Create Alerts](create-alerts.md) on them which makes them more useful than Insights.
122+
123+
:::image type="content" source="media/use-metrics/metadata-requests-metrics.png" alt-text="Screenshot of Metrics pane, highlighting the metadata requests for an account and time granularity of 5 minutes." lightbox="media/use-metrics/metadata-requests-429.png" :::
124+
125+
111126
## Next steps
112127

113128
You might want to learn more about improving database performance by reading the following articles:

0 commit comments

Comments
 (0)