使用 Azure Cosmos DB 容量规划器估算 RU/秒 - 适用于 MongoDB 的 Azure Cosmos DB APIEstimate RU/s using the Azure Cosmos DB capacity planner - Azure Cosmos DB API for MongoDB

适用于: Azure Cosmos DB API for MongoDB

针对工作负载为数据库和集合配置适当数量的预配吞吐量(也称为请求单位 [RU/秒])对于优化成本和性能非常重要。Configuring your databases and collections with the right amount of provisioned throughput, or Request Units (RU/s), for your workload is essential to optimizing cost and performance. 本文介绍如何使用 Azure Cosmos DB 容量规划器来估算使用适用于 MongoDB 的 Azure Cosmos DB API 时工作负载所需的 RU/秒和成本。This article describes how to use the Azure Cosmos DB capacity planner to get an estimate of the required RU/s and cost of your workload when using the Azure Cosmos DB API for MongoDB. 如果使用的是 SQL API,请参阅如何配合使用容量计算器与 SQL API 一文。If you are using SQL API, see how to use capacity calculator with SQL API article.

容量规划器模式Capacity planner modes

模式Mode 说明Description
基本Basic 提供快速、大概的 RU/秒估算。Provides a quick, high-level RU/s estimate. 此模式为索引编制策略、一致性和其他参数采用默认的 Azure Cosmos DB 设置。This mode assumes the default Azure Cosmos DB settings for indexing policy, consistency, and other parameters.

当评估要在 Azure Cosmos DB 上运行的潜在工作负荷时,可以使用基本模式进行快速、大概的估算。Use basic mode for a quick, high-level estimate when you are evaluating a potential workload to run on Azure Cosmos DB. 若要了解详细信息,请参阅如何使用基本模式估算成本To learn more, see how to estimate cost with basic mode.

使用基本模式估算预配吞吐量和成本Estimate provisioned throughput and cost using basic mode

若要使用基本模式针对你的工作负荷进行快速估算,请导航到 Capacity PlannerTo get a quick estimate for your workload using the basic mode, navigate to the capacity planner. 根据工作负载输入以下参数:Input the following parameters based on your workload:

输入Input 说明Description
APIAPI 选择 MongoDB APIChoose MongoDB API
区域数量Number of regions 适用于 MongoDB 的 Azure Cosmos DB API 面向所有 Azure 中国区域提供。Azure Cosmos DB API for MongoDB is available in all Azure China regions. 选择你的工作负荷所需的区域数目。Select the number of regions required for your workload. 可以将任意数量的区域与你的帐户相关联。You can associate any number of regions with your account. 有关更多详细信息,请参阅多区域分布See multiple-region distribution for more details.
多区域写入Multi-region writes 如果你启用多区域写入,则你的应用程序可以在任何 Azure 区域中进行读取和写入。If you enable multi-region writes, your application can read and write to any Azure region. 如果你禁用多区域写入,则你的应用程序可以将数据写入到单个区域。If you disable multi-region writes, your application can write data to a single region.

如果你预计在不同区域中会有需要低延迟写入的主动-主动工作负荷,请启用多区域写入。Enable multi-region writes if you expect to have an active-active workload that requires low latency writes in different regions. 例如,在不同区域中大量向数据库写入数据的 IOT 工作负荷。For example, an IOT workload that writes data to the database at high volumes in different regions.

多区域写入可保证 99.999% 的读取和写入可用性。Multi-region writes guarantees 99.999% read and write availability. 与单一写入区域相比,多区域写入需要更多的吞吐量。Multi-region writes require more throughput when compared to the single write regions. 若要了解详细信息,请参阅单一写入区域与多个写入区域的 RU 有何不同一文。To learn more, see how RUs are different for single and multiple-write regions article.
事务存储中存储的数据总量Total data stored in transactional store 单个区域中的事务存储中存储的预估数据总量 (GB)。Total estimated data stored(GB) in the transactional store in a single region.
使用分析存储Use analytical store 如果要使用 Synapse 分析存储,请选择“打开”。Choose On if you want to use Synapse analytical store. 输入“存储在分析存储中的总数据”,其表示在单个区域的分析存储中存储的数据估值 (GB)。Enter the Total data stored in analytical store, it represents the estimated data stored (GB) in the analytical store in a single region.
项大小Item size 文档的估计大小,范围为 1 KB 到 2 MB。The estimated size of the documents, ranging from 1 KB to 2 MB.
查找数/秒Finds/sec 每个区域每秒的预期查找操作数。Number of find operations expected per second per region.
Inserts/secInserts/sec 每个区域每秒的预期插入操作数。Number of insert operations expected per second per region.
更新次数/秒Updates/sec 每个区域每秒的预期更新操作数。Number of update operations expected per second per region. 选择自动编制索引时,该更新操作的“RU/秒”估计值被当作每次更新更改的一个属性来计算。When you choose automatic indexing, the estimated RU/s for the update operation is calculated as one property being changed per an update.
删除数/秒Deletes/sec 每个区域每秒的预期删除操作数。Number of delete operations expected per second per region.

填写所需的详细信息后,选择“计算”。After filling the required details, select Calculate. “成本估算”选项卡显示预配的吞吐量。The Cost Estimate tab shows provisioned throughput. 可以在此选项卡中展开“显示详细信息”链接,获取不同 CRUD 和查询请求所需的吞吐量的明细。You can expand the Show Details link in this tab to get the breakdown of the throughput required for different CRUD and query requests. 每次更改任何字段的值后,请选择“计算”来重新计算。Each time you change the value of any field, select Calculate to recalculate.

Capacity Planner 基本模式

后续步骤Next steps