您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

使用 Azure Cosmos DB 预留容量优化成本Optimize cost with reserved capacity in Azure Cosmos DB

Azure Cosmos DB 保留容量可通过提交给一年或三年 Azure Cosmos DB 资源的预留来节省资金。Azure Cosmos DB reserved capacity helps you save money by committing to a reservation for Azure Cosmos DB resources for either one year or three years. 使用 Azure Cosmos DB 预留容量,可以获得为 Cosmos DB 资源预配的吞吐量的折扣。With Azure Cosmos DB reserved capacity, you can get a discount on the throughput provisioned for Cosmos DB resources. 资源示例包括数据库和容器(表、集合和图)。Examples of resources are databases and containers (tables, collections, and graphs).

Azure Cosmos DB 预留容量可以大幅降低 Cosmos DB 成本,相比正常价格最多可以降低 65%,前提是提前承诺使用一年或三年的服务。Azure Cosmos DB reserved capacity can significantly reduce your Cosmos DB costs—up to 65 percent on regular prices with a one-year or three-year upfront commitment. 预留容量提供一种计费折扣,并且不会影响 Azure Cosmos DB 资源的运行时状态。Reserved capacity provides a billing discount and doesn't affect the runtime state of your Azure Cosmos DB resources.

Azure Cosmos DB 预留容量涵盖为资源预配的吞吐量的费用。Azure Cosmos DB reserved capacity covers throughput provisioned for your resources. 但它不涵盖存储和网络费用。It doesn't cover the storage and networking charges. 购买预留后,不再像即用即付资费一样收取与预留属性相应的吞吐量费用。As soon as you buy a reservation, the throughput charges that match the reservation attributes are no longer charged at the pay-as-you go rates. 预留相关详细信息,请参阅 Azure 预留一文。For more information on reservations, see the Azure reservations article.

可从 Azure 门户购买 Azure Cosmos DB 预留容量。You can buy Azure Cosmos DB reserved capacity from the Azure portal. 通过提前付款或按月付款的方式为预留付款。Pay for the reservation up front or with monthly payments. 购买预留容量:To buy reserved capacity:

  • 对于至少一个企业或个人订阅,你必须以即用即付费率作为所有者角色。You must be in the Owner role for at least one Enterprise or individual subscription with pay-as-you-go rates.
  • 对于企业订阅,必须在 EA 门户中启用“添加预留实例”。For Enterprise subscriptions, Add Reserved Instances must be enabled in the EA portal. 或者,如果禁用了该设置,则你必须是订阅的 EA 管理员。Or, if that setting is disabled, you must be an EA Admin on the subscription.
  • 对于云解决方案提供商 (CSP) 计划,只有管理员代理或销售代理可以购买 Azure Cosmos DB 预留容量。For the Cloud Solution Provider (CSP) program, only admin agents or sales agents can buy Azure Cosmos DB reserved capacity.

在购买之前确定所需吞吐量Determine the required throughput before purchase

预留大小基于现有的或即将部署的 Azure Cosmos DB 资源将使用的吞吐量总量。The size of the reservation should be based on the total amount of throughput that the existing or soon-to-be-deployed Azure Cosmos DB resources will use. 可按以下方式确定所需的吞吐量:You can determine the required throughput in the following ways:

  • 获取跨所有区域的 Azure Cosmos DB 帐户、数据库和集合中的总预配吞吐量的历史数据。Get the historical data for the total provisioned throughput across your Azure Cosmos DB accounts, databases, and collections across all regions. 例如,可以通过从 https://account.azure.com 下载每日使用情况报表来评估每日平均预配吞吐量。For example, you can evaluate the daily average provisioned throughput by downloading your daily usage statement from https://account.azure.com.

  • 如果你是企业协议 (EA) 客户,可以下载使用情况文件来获取 Azure Cosmos DB 吞吐量详细信息。If you're an Enterprise Agreement (EA) customer, you can download your usage file to get the Azure Cosmos DB throughput details. 请参阅使用情况文件的“其他信息”部分中的“服务类型”值。Refer to the Service Type value in the Additional info section of the usage file.

  • 可以将 Azure Cosmos DB 帐户中预计在接下来的一年或三年中运行的所有工作负载的平均吞吐量相加。You can sum up the average throughput for all the workloads on your Azure Cosmos DB accounts that you expect to run for the next one or three years. 然后可以将相加后的数量用作预留。You can then use that quantity for the reservation.

购买 Azure Cosmos DB 预留容量Buy Azure Cosmos DB reserved capacity

  1. 登录到 Azure 门户Sign in to the Azure portal.

  2. 选择“所有服务” > “预留” > “添加”。Select All services > Reservations > Add.

  3. 从 "采购预订" 窗格中,选择 " Azure Cosmos DB " 以购买新预订。From the Purchase reservations pane, choose Azure Cosmos DB to buy a new reservation.

  4. 填写必填字段,如下表所示:Fill in the required fields as described in the following table:

    填写预留容量表

    字段Field 描述Description
    范围Scope 控制有多少订阅可以使用与预留关联的计费权益的选项。Option that controls how many subscriptions can use the billing benefit associated with the reservation. 它还控制将预留应用于特定订阅的方式。It also controls how the reservation is applied to specific subscriptions.

    如果选择“共享”,预留折扣将应用到计费上下文内任何订阅中运行的 Azure Cosmos DB 实例。If you select Shared, the reservation discount is applied to Azure Cosmos DB instances that run in any subscription within your billing context. 计费上下文基于 Azure 的注册方式。The billing context is based on how you signed up for Azure. 对于企业客户,共享范围是注册范围,包括注册中的所有订阅。For enterprise customers, the shared scope is the enrollment and includes all subscriptions within the enrollment. 对于即用即付客户,共享范围是由帐户管理员创建的即用即付费率的所有订阅。For pay-as-you-go customers, the shared scope is all individual subscriptions with pay-as-you-go rates created by the account administrator.

    如果选择“单个订阅”,预留折扣将应用到所选订阅中的 Azure Cosmos DB 实例。If you select Single subscription, the reservation discount is applied to Azure Cosmos DB instances in the selected subscription.

    如果选择 "单个资源组",则预订折扣将应用于所选订阅中的 Azure Cosmos DB 实例和该订阅内的所选资源组。If you select Single resource group, the reservation discount is applied to Azure Cosmos DB instances in the selected subscription and the selected resource group within that subscription.

    购买预留容量后,可以更改预留范围。You can change the reservation scope after you buy the reserved capacity.
    SubscriptionSubscription 用于支付 Azure Cosmos DB 预留容量费用的订阅。Subscription that's used to pay for the Azure Cosmos DB reserved capacity. 所选订阅的付款方式用于对成本进行收费。The payment method on the selected subscription is used in charging the costs. 订阅必须是以下类型之一:The subscription must be one of the following types:

    企业协议(产品/服务编号: BC-OP-NT-AZR-Ms-azr-0017p 或 BC-OP-NT-AZR-Ms-azr-0148p):对于企业订阅,将从注册的货币承诺余额中扣除费用,或将其收费为超额。Enterprise Agreement (offer numbers: MS-AZR-0017P or MS-AZR-0148P): For an Enterprise subscription, the charges are deducted from the enrollment's monetary commitment balance or charged as overage.

    使用即用即付费率的单个订阅(产品/服务编号: BC-OP-NT-AZR-Ms-azr-0003p 或 BC-OP-NT-AZR-0023P):对于使用即用即付费率的单个订阅,将对订阅上的信用卡或发票付款方式收取费用。Individual subscription with pay-as-you-go rates (offer numbers: MS-AZR-0003P or MS-AZR-0023P): For an individual subscription with pay-as-you-go rates, the charges are billed to the credit card or invoice payment method on the subscription.
    资源组Resource Group 将保留的容量折扣应用到的资源组。Resource group to which the reserved capacity discount is applied.
    条款Term 一年或三年。One year or three years.
    吞吐量类型Throughput Type 吞吐量设置为 "请求单位"。Throughput is provisioned as request units. 你可以为设置-单区域写入和多个区域写入购买预配吞吐量的预留。You can buy a reservation for the provisioned throughput for both setups - single region writes as well as multiple region writes. 吞吐量类型具有两个要选择的值:每小时 100 RU/秒和每小时100多主机 RU/秒。The throughput type has two values to choose from: 100 RU/s per hour and 100 Multi-master RU/s per hour.
    保留容量单位Reserved Capacity Units 想预留的吞吐量的量。The amount of throughput that you want to reserve. 可以通过确定每个区域的所有 Cosmos DB 资源(例如,数据库或容器)所需的吞吐量来计算此值。You can calculate this value by determining the throughput needed for all your Cosmos DB resources (for example, databases or containers) per region. 然后,将其与 Cosmos 数据库关联的区域数相乘。You then multiply it by the number of regions that you'll associate with your Cosmos database. 例如:如果有五个区域,每个区域 1 百万 RU/秒,则购买预留容量时应选 5 百万 RU/秒。For example: If you have five regions with 1 million RU/sec in every region, select 5 million RU/sec for the reservation capacity purchase.
  5. 填写该表单后,将计算购买保留容量所需的价格。After you fill the form, the price required to purchase the reserved capacity is calculated. 输出还会显示所选选项的折扣百分比。The output also shows the percentage of discount you get with the chosen options. 下一步单击选择Next click Select

  6. 在 "购买预订" 窗格中,查看预订的折扣和价格。In the Purchase reservations pane, review the discount and the price of the reservation. 此预留价格适用于使用跨所有区域预配的吞吐量的 Azure Cosmos DB 资源。This reservation price applies to Azure Cosmos DB resources with throughput provisioned across all regions.

    保留的容量摘要

  7. 选择 "查看" 和 "立即购买"。Select Review + buy and then buy now. 购买成功后,会看到如下页面所示内容:You see the following page when the purchase is successful:

购买预留后,它立即应用到与预留期相符的所有现有 Azure Cosmos DB 资源。After you buy a reservation, it's applied immediately to any existing Azure Cosmos DB resources that match the terms of the reservation. 如果还没有 Azure Cosmos DB 资源,则将在你部署符合预留期的新 Cosmos DB 实例时应用预留。If you don’t have any existing Azure Cosmos DB resources, the reservation will apply when you deploy a new Cosmos DB instance that matches the terms of the reservation. 这两种情况的预留期均于成功购买后立即开始。In both cases, the period of the reservation starts immediately after a successful purchase.

预留到期时,Azure Cosmos DB 实例会继续运行,按正常即用即付资费计费。When your reservation expires, your Azure Cosmos DB instances continue to run and are billed at the regular pay-as-you-go rates.

对预留执行取消、交换或退款操作Cancel, exchange, or refund reservations

有关确定正确保留容量的帮助,请参阅了解如何将预订折扣应用到 Azure Cosmos DBFor help with identifying the right reserved capacity, see Understand how the reservation discount is applied to Azure Cosmos DB.

可以在一定的限制下对预留执行取消、交换或退款操作。You can cancel, exchange, or refund reservations with certain limitations. 有关详细信息,请参阅 Azure 预留的自助交换和退款For more information, see Self-service exchanges and refunds for Azure Reservations.

后续步骤Next steps

预留折扣自动应用于与预留范围和属性相符的 Azure Cosmos DB 资源。The reservation discount is applied automatically to the Azure Cosmos DB resources that match the reservation scope and attributes. 可以通过 Azure 门户、PowerShell、Azure CLI 或 API 更新预留的范围。You can update the scope of the reservation through the Azure portal, PowerShell, Azure CLI, or the API.

需要帮助?Need help? 联系我们。Contact us.

如有任何疑问或需要帮助,请创建支持请求If you have questions or need help, create a support request.