

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# Amazon DocumentDB 配额和限制
<a name="limits"></a>

本主题介绍 Amazon DocumentDB（与 MongoDB 兼容）的资源配额、限制和命名约束。

对于某些管理功能，Amazon DocumentDB 使用与 Amazon Relational Database Service (Amazon RDS) 和 Amazon Neptune 共享的操作技术。

**Topics**
+ [

## 支持的实例类型
](#limits-suported_instance_types)
+ [

## 支持的区域
](#limits-region_availability)
+ [

## 区域配额
](#limits-regional_quotas)
+ [

## 聚合限制
](#limits-aggregation)
+ [集群限制](#limits-cluster)
+ [

## 实例限制
](#limits.instance)
+ [命名约束](#limits-naming_constraints)
+ [

## TTL 约束
](#limits.ttl-constraints)
+ [

## 弹性集群限制
](#elastic.cluster.limits)
+ [

## 弹性集群分片限制
](#elastic.cluster.shard.limits)
+ [

## 每个分片的弹性集群 CPU、内存、连接和光标限制
](#elastic.cluster.memory.limits)

## 支持的实例类型
<a name="limits-suported_instance_types"></a>

Amazon DocumentDB 支持按需实例和以下实例类型：
+ NVMe-支持：
  + **R6GD 实例类型：** `db.r6gd.xlarge`、`db.r6gd.2xlarge`、`db.r6gd.4xlarge`、`db.r6gd.8xlarge`、`db.r6gd.12xlarge`、`db.r6gd.16xlarge`。
+ 内存优化:
  + **R8G 实例类型：**`db.r8g.large`、、`db.r8g.xlarge`、、`db.r8g.2xlarge`、`db.r8g.4xlarge``db.r8g.8xlarge`、`db.r8g.12xlarge`。`db.r8g.16xlarge`
  + **R6G 实例类型：**`db.r6g.large`、、`db.r6g.xlarge`、、`db.r6g.2xlarge`、`db.r6g.4xlarge``db.r6g.8xlarge`、`db.r6g.12xlarge`。`db.r6g.16xlarge`
  + **R5 实例类型：**`db.r5.large`、、`db.r5.xlarge`、`db.r5.2xlarge`、`db.r5.4xlarge`、`db.r5.8xlarge``db.r5.12xlarge`、`db.r5.16xlarge`。
  + **R4 实例类型：**`db.r4.large`、`db.r4.2xlarge`、`db.r4.4xlarge`、`db.r4.8xlarge`、`db.r4.16xlarge`。
+ 可突增性能：
  + **T4G 实例类型：**`db.t4g.medium`。
  + **T3 实例类型：** `db.t3.medium`。

有关支持的实例类型及其规范的更多信息，请参阅[实例类规格](db-instance-classes.md#db-instance-class-specs)。

## 支持的区域
<a name="limits-region_availability"></a>

亚马逊 DocumentDB 可在以下 AWS 地区使用：


| 区域名称 | Region | 可用区（计算） | 
| --- | --- | --- | 
| 美国东部（俄亥俄州） | `us-east-2` | 3 | 
| 美国东部（弗吉尼亚州北部） | `us-east-1` | 6 | 
| 美国西部（俄勒冈州） | `us-west-2` | 4 | 
| 非洲（开普敦） | `af-south-1` | 3 | 
| 南美洲（圣保罗） | `sa-east-1` | 3 | 
| 亚太地区（香港） | `ap-east-1` | 3 | 
| 亚太地区（海得拉巴） | `ap-south-2` | 3 | 
| 亚太地区（马来西亚） | `ap-southeast-5` | 3 | 
| 亚太地区（孟买） | `ap-south-1` | 3 | 
| 亚太地区（大阪） | `ap-northeast-3` | 3 | 
| 亚太地区（首尔） | `ap-northeast-2` | 4 | 
| 亚太地区（新加坡） | `ap-southeast-1` | 3 | 
| 亚太地区（悉尼） | `ap-southeast-2` | 3 | 
| 亚太地区（雅加达） | `ap-southeast-3` | 3 | 
| 亚太地区（墨尔本） | `ap-southeast-4` | 3 | 
| 亚太地区（泰国） | `ap-southeast-7` | 3 | 
| 亚太地区（东京） | `ap-northeast-1` | 3 | 
| 加拿大（中部） | `ca-central-1` | 3 | 
| 中国（北京）区域 | `cn-north-1` | 3 | 
| 中国（宁夏） | `cn-northwest-1` | 3 | 
| 欧洲地区（法兰克福） | `eu-central-1` | 3 | 
| 欧洲（苏黎世） | `eu-central-2` | 3 | 
| 欧洲地区（爱尔兰） | `eu-west-1` | 3 | 
| 欧洲地区（伦敦） | `eu-west-2` | 3 | 
| 欧洲地区（米兰） | `eu-south-1` | 3 | 
| 欧洲地区（巴黎） | `eu-west-3` | 3 | 
| 欧洲（西班牙） | `eu-south-2` | 3 | 
| 欧洲地区（斯德哥尔摩） | `eu-north-1` | 3 | 
| 墨西哥（中部） | `mx-central-1` | 3 | 
| 中东（阿联酋）： | `me-central-1` | 3 | 
| 以色列（特拉维夫） | `il-central-1` | 3 | 
| AWS GovCloud （美国西部） | `us-gov-west-1` | 3 | 
| AWS GovCloud （美国东部） | `us-gov-east-1` | 3 | 

## 区域配额
<a name="limits-regional_quotas"></a>

对于某些管理功能，Amazon DocumentDB 使用与 Amazon Relational Database Service (Amazon RDS) 共享的操作技术。下表包含在 Amazon DocumentDB 和 Amazon RDS 之间共享的区域限制。

**注意**  
上述 Amazon RDS 共享技术仅适用于 Amazon DocumentDB 基于实例的集群。Amazon DocumentDB 弹性集群不与 Amazon RDS 共享技术。

以下限制适用于基于 Amazon DocumentDB 实例的集群，并且每个区域的每个 AWS 账户都有以下限制。


| 资源 | AWS 默认限制 | 
| --- | --- | 
| 集群 | 40 | 
| 集群参数组 | 50 | 
| 每个参数组的集群 | 100 | 
| 每个参数组的实例数 | 300 | 
| 事件订阅 | 20 | 
| 实例 | 40 | 
| 手动集群快照 | 100 | 
| 每个集群的只读副本数 | 15 | 
| 子网组 | 50 | 
| 每个子网组的子网数 | 20 | 
| 每个资源的标签 | 50 | 
| 每个实例的 VPC 安全组数 | 5 | 

以下限制适用于 Amazon DocumentDB 弹性集群，并且每个区域的每个 AWS 账户都有以下限制。


| 资源 | AWS 默认限制 | 
| --- | --- | 
| 弹性集群 | 20 | 
| 弹性集群 vCPU | 1024 | 
| 手动弹性集群快照 | 20 | 

如果配额是可调整的，则可以使用服务配额来请求增加配额。有些请求会自动得到解决，而另一些则提交给 支持。您可以跟踪已提交给的增加配额请求的状态 支持。提高服务配额的请求没有得到优先支持。如果您有紧急请求，请联系 [支持](https://aws.amazon.com/premiumsupport/)。有关服务配额的更多信息，请参阅[什么是服务配额？](https://docs.aws.amazon.com//servicequotas/latest/userguide/intro.html)

**要请求增加 Amazon DocumentDB 的限额，请执行以下操作：**

1. 通过 [https://console.aws.amazon.com/servicequotas](https://console.aws.amazon.com/servicequotas) 打开服务配额控制台，如有必要，请登录。

1. 在导航窗格中，选择 **AWS 服务**。

1. 从列表中选择 Amazon DocumentDB（兼容 MongoDB）或 Amazon DocumentDB 弹性集群，或者在搜索栏中键入任何一个条目。

1. 如果配额是可调整的，您可以选择其单选按钮或其名称，然后从页面右上角选择 **Request quota increase (请求增加配额)**。

1. 对于 **Change quota value (更改配额值)**，输入新值。新值必须大于当前值。

1. 选择**请求**。解决请求后，配额的 **Applied quota value (应用的配额值)** 设置为新值。

1. 要查看任何待处理或最近解决的请求，请从导航窗格选择 **Dashboard (控制面板)**。对于待处理的请求，请选择请求状态以打开收到的请求。请求的初始状态为 `Pending`。状态更改为后`Quota requested`，您将看到带有的案例编号 支持。选择案例编号以打开请求服务单。

## 聚合限制
<a name="limits-aggregation"></a>

下表介绍了 Amazon DocumentDB 中的聚合限制。


| 资源 | 限制 | 
| --- | --- | 
| 受支持的最大阶段数 | 500 | 

## 集群限制
<a name="limits-cluster"></a>

下表介绍了 Amazon DocumentDB 基于实例的集群的限制。


| 资源 | 限制 | 
| --- | --- | 
| 集群大小（所有集合的索引的总和） | 128 TiB | 
| 集合大小（所有集合的总和不能超过集群限制）— 不包括索引大小 | 32 TiB | 
| 每集群的集合数 | 100000 | 
| 每集群的数据库数 | 100000 | 
| 数据库大小（所有数据库的总和不能超过集群限制） | 128 TiB | 
| 文档嵌套深度 | 200 个级别 | 
| 文档大小 | 16 MiB | 
| 索引键大小 | 2,048 字节 | 
| 每个集合索引一次 | 64 | 
| 复合索引中的键 | 32 | 
| 单个批处理命令中的最大写入次数 | 100000 | 
| 每个集群的用户数 | 1000 | 

## 实例限制
<a name="limits.instance"></a>

下表介绍了每个实例中 Amazon DocumentDB 集群的限制。

------
#### [ Amazon DocumentDB 8.0 ]


| 实例类型 | 实例内存 (GiB) | 连接（全部） | 光标限制 | 未完成事务 | 连接（活动） | 
| --- | --- | --- | --- | --- | --- | 
| T3.medium | 4 | 1000 | 30 | 50 | 102 | 
| T4G.medium | 4 | 1000 | 30 | 50 | 102 | 
| R5.large | 16 | 3400 | 450 | 200 | 1100 | 
| R5.xlarge | 32 | 7000 | 450 | 400 | 2700 | 
| R5.2xlarge | 64 | 14200 | 450 | 800 | 4500 | 
| R5.4xlarge | 128 | 28400 | 760 | 1600 | 4500 | 
| R5.8xlarge | 256 | 60000 | 1520 | 3200 | 4500 | 
| R5.12xlarge | 384 | 60000 | 2280 | 4800 | 4500 | 
| R5.16xlarge | 512 | 60000 | 3040 | 6400 | 4500 | 
| R6G.large\$1 | 16 | 3400 | 450 | 200 | 1100 | 
| R6G.xlarge\$1 | 32 | 7000 | 450 | 400 | 2700 | 
| R6G.2xlarge\$1 | 64 | 14200 | 450 | 800 | 4500 | 
| R6G.4xlarge\$1 | 128 | 28400 | 760 | 1600 | 4500 | 
| R6G.8xlarge\$1 | 256 | 60000 | 1520 | 3200 | 4500 | 
| R6G.12xlarge\$1 | 384 | 60000 | 2280 | 4800 | 4500 | 
| R6G.16xlarge\$1 | 512 | 60000 | 3040 | 6400 | 4500 | 
| r8g.large | 16 | 3400 | 450 | 200 | 1100 | 
| r8g.xLarge | 32 | 7000 | 450 | 400 | 2700 | 
| r8g.2xLarge | 64 | 14200 | 450 | 800 | 4500 | 
| r8g.4xLarge | 128 | 28400 | 760 | 1600 | 4500 | 
| r8g.8xLarge | 256 | 60000 | 1520 | 3200 | 4500 | 
| r8g.12xLarge | 384 | 60000 | 2280 | 4800 | 4500 | 
| r8g.16xLarge | 512 | 60000 | 3040 | 6400 | 4500 | 

\$1 包括 R6GD

------
#### [ Amazon DocumentDB 5.0 ]


| 实例类型 | 实例内存 (GiB) | 连接（全部） | 光标限制 | 未完成事务 | 连接（活动） | 
| --- | --- | --- | --- | --- | --- | 
| T3.medium | 4 | 1000 | 30 | 50 | 102 | 
| T4G.medium | 4 | 1000 | 30 | 50 | 102 | 
| R5.large | 16 | 3400 | 450 | 200 | 1100 | 
| R5.xlarge | 32 | 7000 | 450 | 400 | 2700 | 
| R5.2xlarge | 64 | 14200 | 450 | 800 | 4500 | 
| R5.4xlarge | 128 | 28400 | 760 | 1600 | 4500 | 
| R5.8xlarge | 256 | 60000 | 1520 | 3200 | 4500 | 
| R5.12xlarge | 384 | 60000 | 2280 | 4800 | 4500 | 
| R5.16xlarge | 512 | 60000 | 3040 | 6400 | 4500 | 
| R6G.large\$1 | 16 | 3400 | 450 | 200 | 1100 | 
| R6G.xlarge\$1 | 32 | 7000 | 450 | 400 | 2700 | 
| R6G.2xlarge\$1 | 64 | 14200 | 450 | 800 | 4500 | 
| R6G.4xlarge\$1 | 128 | 28400 | 760 | 1600 | 4500 | 
| R6G.8xlarge\$1 | 256 | 60000 | 1520 | 3200 | 4500 | 
| R6G.12xlarge\$1 | 384 | 60000 | 2280 | 4800 | 4500 | 
| R6G.16xlarge\$1 | 512 | 60000 | 3040 | 6400 | 4500 | 
| r8g.large | 16 | 3400 | 450 | 200 | 1100 | 
| r8g.xLarge | 32 | 7000 | 450 | 400 | 2700 | 
| r8g.2xLarge | 64 | 14200 | 450 | 800 | 4500 | 
| r8g.4xLarge | 128 | 28400 | 760 | 1600 | 4500 | 
| r8g.8xLarge | 256 | 60000 | 1520 | 3200 | 4500 | 
| r8g.12xLarge | 384 | 60000 | 2280 | 4800 | 4500 | 
| r8g.16xLarge | 512 | 60000 | 3040 | 6400 | 4500 | 

\$1 包括 R6GD

------
#### [ Amazon DocumentDB 4.0 ]


| 实例类型 | 实例内存 (GiB) | 连接（全部） | 光标限制 | 未完成事务 | 连接（活动） | 
| --- | --- | --- | --- | --- | --- | 
| T3.medium | 4 | 1000 | 30 | 50 | 102 | 
| T4G.medium | 4 | 1000 | 30 | 50 | 102 | 
| R5.large | 16 | 3400 | 450 | 200 | 1100 | 
| R5.xlarge | 32 | 7000 | 450 | 400 | 2700 | 
| R5.2xlarge | 64 | 14200 | 450 | 800 | 4500 | 
| R5.4xlarge | 128 | 28400 | 760 | 1600 | 4500 | 
| R5.8xlarge | 256 | 60000 | 1520 | 3200 | 4500 | 
| R5.12xlarge | 384 | 60000 | 2280 | 4800 | 4500 | 
| R5.16xlarge | 512 | 60000 | 3040 | 6400 | 4500 | 
| R6G.large\$1 | 16 | 3400 | 450 | 200 | 1100 | 
| R6G.xlarge\$1 | 32 | 7000 | 450 | 400 | 2700 | 
| R6G.2xlarge\$1 | 64 | 14200 | 450 | 800 | 4500 | 
| R6G.4xlarge\$1 | 128 | 28400 | 760 | 1600 | 4500 | 
| R6G.8xlarge\$1 | 256 | 60000 | 1520 | 3200 | 4500 | 
| R6G.12xlarge\$1 | 384 | 60000 | 2280 | 4800 | 4500 | 
| R6G.16xlarge\$1 | 512 | 60000 | 3040 | 6400 | 4500 | 

\$1 包括 R6GD

------
#### [ Amazon DocumentDB 3.6 ]


| 实例类型 | 实例内存 (GiB) | 连接（全部） | 光标限制 | 未完成事务 | 连接（活动） | 
| --- | --- | --- | --- | --- | --- | 
| T3.medium | 4 | 500 | 30 | 不适用 | 102 | 
| R4.large | 15.25 | 1700 | 450 | 不适用 | 1100 | 
| R4.xlarge | 30.5 | 3400 | 450 | 不适用 | 2700 | 
| R4.2xlarge | 61 | 6800 | 450 | 不适用 | 4500 | 
| R4.4xlarge | 122 | 13600 | 725 | 不适用 | 4500 | 
| R4.8xlarge | 288 | 27200 | 1450 | 不适用 | 4500 | 
| R4.16xlarge | 488 | 30000 | 2900 | 不适用 | 4500 | 
| R5.large | 16 | 1700 | 450 | 不适用 | 1100 | 
| R5.xlarge | 32 | 3500 | 450 | 不适用 | 2700 | 
| R5.2xlarge | 64 | 7100 | 450 | 不适用 | 4500 | 
| R5.4xlarge | 128 | 14200 | 760 | 不适用 | 4500 | 
| R5.8xlarge | 256 | 28400 | 1520 | 不适用 | 4500 | 
| R5.12xlarge | 384 | 30000 | 2280 | 不适用 | 4500 | 
| R5.16xlarge | 512 | 30000 | 3040 | 不适用 | 4500 | 

------

您可以使用以下 CloudWatch 指标监控每个实例的限制并发出警报。有关亚马逊 DocumentDB CloudWatch 指标的更多信息，请参阅。[使用以下方式监控亚马逊 DocumentDB CloudWatch](cloud_watch.md)


| 资源 | CloudWatch 限制指标 | CloudWatch 使用量指标（最大 1 分钟） | CloudWatch 使用量指标 | 
| --- | --- | --- | --- | 
| 实例内存 | - | - | FreeableMemory | 
| 连接（全部） | DatabaseConnectionsLimit | DatabaseConnectionsMax | DatabaseConnections | 
| 游标 | DatabaseCursorsLimit | DatabaseCursorsMax | DatabaseCursors | 
| 事务 | TransactionsOpenLimit | TransactionsOpenMax | TransactionsOpen | 

## 命名约束
<a name="limits-naming_constraints"></a>

下表介绍 Amazon DocumentDB 中的命名约束。


| 资源 | 默认限制 | 
| --- | --- | 
| 集群标识符 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/documentdb/latest/developerguide/limits.html)  | 
| 集合名称：<col> |  长度为 [1-57] 个字符。  | 
| 数据库名称：<db> |  长度为 [1-63] 个字符。  | 
| 完全限定集合名称：<db>.<col> | 长度为 [3–120] 个字符。 | 
| 完全限定索引名称：<db>.<col>\$1<index> | 长度为 [6–377] 个字符。 | 
| 索引名称：<col>\$1<index> |  长度为 [3–255] 个字符。  | 
| 实例标识符 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/documentdb/latest/developerguide/limits.html)  | 
| 主密码 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/documentdb/latest/developerguide/limits.html) | 
| 主用户名称 |  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/documentdb/latest/developerguide/limits.html)  | 
| 参数组名称 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_cn/documentdb/latest/developerguide/limits.html) | 

## TTL 约束
<a name="limits.ttl-constraints"></a>

在特定时间范围内无法保证从 TTL 索引中删除，只能尽力而为。实例资源利用率、文档大小和总体吞吐量等因素会影响 TTL 删除的时间。

## 弹性集群限制
<a name="elastic.cluster.limits"></a>

下表介绍了 Amazon DocumentDB 弹性集群的最大限制。


| 资源 | 限制 | 
| --- | --- | 
| 每个区域的弹性集群 | 20 | 
| 每个区域所有弹性集群的 vCPU 总和 | 1024 | 
| 每个区域的手动集群快照 | 20 | 
| 每个集群的分片数 | 32 | 
| 每个集群的存储空间（当数据通过分片密钥均匀分布时） | 4 PiB | 
| 集群的连接 | 300,000 或分片数量 x 与每个分片的 vCPU 相关的连接限制，取较低的值 | 
| UnSharded 藏品大小 | 32 TiB | 
| 分片集合大小（当数据通过分片键均匀分布时） | 1PB | 
| 每集群的数据库数 | 10000 | 
| UnSharded 每个集群的集合 | 100000 | 
| 每个集群的分片集群 | 1000 | 
| 每个集群的用户 | 100 | 
| 单个批处理命令中的写入次数 | 100000 | 
| 每个集合索引一次 | 64 | 
| 文档嵌套深度 | 100 个级别 | 
| 文档大小 | 16 MB | 
| 索引键大小 | 2048 字节 | 
| 复合索引中的键 | 32 | 

## 弹性集群分片限制
<a name="elastic.cluster.shard.limits"></a>

下表介绍了 Amazon DocumentDB 弹性集群的最大分片限制。


| 资源 | 限制 | 
| --- | --- | 
| 每个分片实例的 vCPU | 64 | 
| 每个分片的实例 | 16 | 
| 每个分片的存储 | 128 TiB | 
| 每个分片的每个集合的存储空间 | 32 TiB | 

## 每个分片的弹性集群 CPU、内存、连接和光标限制
<a name="elastic.cluster.memory.limits"></a>

下表描述了 Amazon DocumentDB 弹性集群分片中的最大 CPU、内存、连接和光标限制。


| CPUs 每个分片 v | 实例内存 (GiB) | 连接限制 | 光标限制 | 
| --- | --- | --- | --- | 
| 2 | 16 | 1700 | 450 | 
| 4 | 32 | 3500 | 450 | 
| 8 | 64 | 7100 | 450 | 
| 16 | 128 | 14200 | 760 | 
| 32 | 256 | 28400 | 1520 | 
| 48 | 384 | 30000 | 2280 | 
| 64 | 512 | 30000 | 3040 | 