Skip to content

Commit 584504d

Browse files
authored
Merge pull request #98471 from deborahc/dech-cosmos-ru-partitioning-docs
Cosmos DB Autopilot FAQ
2 parents 1461a06 + 45d1419 commit 584504d

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

articles/cosmos-db/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@
129129
href: set-throughput.md
130130
- name: Provision throughput - autopilot mode
131131
href: provision-throughput-autopilot.md
132+
- name: Autopilot FAQ
133+
href: autopilot-faq.md
132134
- name: SQL query reference
133135
items:
134136
- name: Getting started

articles/cosmos-db/autopilot-faq.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: Frequently asked questions about throughput in Azure Cosmos DB autopilot mode
3+
description: Frequently asked questions about autopilot mode for Azure Cosmos DB databases and containers
4+
author: deborahc
5+
ms.author: dech
6+
ms.service: cosmos-db
7+
ms.topic: conceptual
8+
ms.date: 12/16/2019
9+
---
10+
11+
# Frequently asked questions about provisioned throughput in Azure Cosmos DB autopilot mode (Preview)
12+
With autopilot mode, Azure Cosmos DB will automatically manage and scale the RU/s of your container or database based on usage. This article answers commonly asked questions about autopilot mode.
13+
14+
## Frequently asked questions
15+
16+
### Is autopilot mode supported for all APIs?
17+
Yes, autopilot mode is supported for all APIs: Core (SQL), Gremlin, Table, Cassandra, and API for MongoDB.
18+
19+
### Is autopilot mode supported for multi-master accounts?
20+
Yes, autopilot mode is supported for multi-master accounts. The max RU/s are available in each region that is added to the Cosmos account.
21+
22+
### What is the pricing for autopilot?
23+
Refer to the Azure Cosmos DB [pricing page](https://azure.microsoft.com/pricing/details/cosmos-db/) for details.
24+
25+
### How do I enable autopilot for my containers or databases?
26+
Autopilot mode can be enabled on new containers and databases created using the Azure portal.
27+
28+
### Is there CLI or SDK support to create containers or databases with autopilot mode?
29+
Currently, in the preview release, you can only create resources with autopilot mode from the Azure portal. Support for CLI and SDK is not yet available.
30+
31+
### Can I enable autopilot on an existing container or a database?
32+
Currently, you can enable autopilot on new containers and databases when creating them. Support to enable autopilot mode on existing containers and databases is not yet available. You can migrate existing containers to a new container using [Azure Data Factory](../data-factory/connector-azure-cosmos-db.md) or [change feed](change-feed.md).
33+
34+
### Can I turn off autopilot mode on a container or database?
35+
Yes, you can turn off autopilot by switching to the 'Manual' option for the provisioned throughput. In the preview release, after switching from autopilot mode to manual mode, you cannot enable autopilot again for the same resource.
36+
37+
### Is autopilot mode supported for shared throughput databases?
38+
Yes, autopilot mode is supported for shared throughput databases. To enable this feature, select autopilot mode and the **Provision throughput** option when creating the database.
39+
40+
### What is the number of allowed collections per shared throughput database when autopilot is enabled?
41+
For shared throughput databases with autopilot mode enabled, the number of allowed collections is: MIN(25, Max RU/s of database / 1000). For example, if the max throughput of the database is 20,000 RU/s, the database can have MIN(25, 20,000 RU/s / 1000) = 20 collections.
42+
43+
44+
### What is the storage limit associated with each max RU/s option?
45+
The storage limit in GB for each max RU/s is: Max RU/s of database or container / 100. For example, if the max RU/s is 20,000 RU/s, the resource can support 200 GB of storage.
46+
See the [autopilot limits](provision-throughput-autopilot.md#autopilot-limits) article for the available max RU/s and storage options.
47+
48+
### What happens if I exceed the storage limit associated with my max throughput?
49+
If the storage limit associated with the max throughput of the database or container is exceeded, Azure Cosmos DB will automatically increase the max throughput to the next highest tier that can support that level of storage. For example, suppose a database or container is provisioned with the 4000 RU/s max throughput option, which has a storage limit of 50 GB. If the storage of the resource increases to 100 GB, the max RU/s of the database or container will be automatically increased to 20,000 RU/s, which can support up to 200 GB.
50+
51+
### How quickly will autopilot scale up and down based on spikes in traffic?
52+
Autopilot will instantaneously scale up or scale down the RU/s within the minimum and maximum RU/s range, based on incoming traffic. Billing is done at a 1-hour granularity, where you are charged for the highest RU/s in a particular hour.
53+
54+
### Can I specify a custom max throughput (RU/s) value for autopilot mode?
55+
Currently, during the preview release, you can select between [four options](provision-throughput-autopilot.md#autopilot-limits) for max throughput (RU/s).
56+
57+
### Can I increase the max RU/s (move to a higher tier) on the database or container?
58+
Yes. From the **Scale & Settings** option for your container, or **Scale** option for your database, you can select a higher max RU/s for autopilot. This is an asynchronous scale-up operation that may take sometime to complete (typically 4-6 hours, depending on the RU/s selected) as the service provisions more resources to support the higher scale.
59+
60+
### Can I reduce the max RU/s (move to a lower tier) on the database or container?
61+
Yes. As long as the current storage of the database or container is below the [storage limit](#what-is-the-storage-limit-associated-with-each-max-rus-option) associated with the max RU/s tier you want to scale down to, you can reduce the max RU/s to that tier. For example, if you have selected 20,000 RU/s as the max RU/s, you can scale down the max RU/s to 4000 RU/s if you have less than 50 GB of storage (the storage limit associated with 4000 RU/s).
62+
63+
### What is the mapping between the max RU/s and physical partitions?
64+
When you first select the max RU/s, Azure Cosmos DB will provision: Max RU/s / 10,000 RU/s = # of physical partitions. Each [physical partition](partition-data.md#physical-partitions) can support up to 10,000 RU/s and 50 GB storage. As storage size grows, Azure Cosmos DB will automatically split the partitions to add more physical partitions to handle the storage increase, or increase the max RU/s tier if storage [exceeds the associated limit](#what-is-the-storage-limit-associated-with-each-max-rus-option).
65+
66+
The Max RU/s of the database or container is divided evenly across all physical partitions. So, the total throughput any single physical partition can scale to is: Max RU/s of database or container / # physical partitions.
67+
68+
### What happens if incoming requests exceed the max RU/s of the database or container?
69+
If the overall consumed RU/s exceeds the max RU/s of the container or database, requests that exceed the max RU/s will be throttled and return a 429 status code. Requests that result in over 100% normalized utilization will also be throttled. Normalized utilization is defined as the max of the RU/s utilization across all physical partitions. For example, suppose your max throughput is 20,000 RU/s and you have two physical partitions, P_1 and P_2, each capable of scaling to 10,000 RU/s. In a given second, if P_1 has used 6000 RUs, and P_2 8000 RUs, the normalized utilization is MAX(6000 RU / 10,000 RU, 8000 RU / 10,000 RU) = 0.8.
70+
71+
> [!NOTE]
72+
> The Azure Cosmos DB client SDKs and data import tools (Azure Data Factory, bulk executor library) automatically retry on 429s, so occasional 429s are fine. A sustained high number of 429s may indicate you need to increase the max RU/s or review your partitioning strategy for a [hot partition](#is-it-still-possible-to-see-429s-throttlingrate-limiting-when-autopilot-is-enabled).
73+
74+
### Is it still possible to see 429s (throttling/rate limiting) when autopilot is enabled?
75+
Yes. It is possible to see 429s in two scenarios. First, when the overall consumed RU/s exceeds the max RU/s of the container or database, the service will throttle requests accordingly.
76+
77+
Second, if there is a hot partition, i.e. a logical partition key value that has a disproportionately higher amount of requests compared to other partition key values, it is possible for the underlying physical partition to exceed its RU/s budget. As a best practice, to avoid hot partitions, [choose a good partition key](partitioning-overview.md#choose-partitionkey) that results in an even distribution of both storage and throughput.
78+
79+
For example, if you select the 20,000 RU/s max throughput option and have 200 GB of storage, with four physical partitions, each physical partition can be autoscaled up to 5000 RU/s. If there was a hot partition on a particular logical partition key, you will see 429s when the underlying physical partition it resides in exceeds 5000 RU/s, i.e. exceeds 100% normalized utilization.
80+
81+
## Next steps
82+
83+
* Learn how to [enable autopilot on an Azure Cosmos container or database](provision-throughput-autopilot.md#enable-autopilot).
84+
* Learn about the [benefits of autopilot](provision-throughput-autopilot.md#benefits-of-autopilot-mode).
85+
* Learn more about [logical and physical partitions](partition-data.md).

articles/cosmos-db/provision-throughput-autopilot.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ The following table shows the maximum throughout and storage limits for differen
102102

103103
## Next steps
104104

105+
* Review the [autopilot FAQ](autopilot-faq.md).
105106
* Learn more about [logical partitions](partition-data.md).
106107
* Learn how to [provision throughput on an Azure Cosmos container](how-to-provision-container-throughput.md).
107108
* Learn how to [provision throughput on an Azure Cosmos database](how-to-provision-database-throughput.md).

0 commit comments

Comments
 (0)