了解 Azure Cosmos DB 帐单Understand your Azure Cosmos DB bill

Azure Cosmos DB 是完全托管的云原生数据库服务,仅针对预配的吞吐量和消耗的存储收费,从而简化计费。As a fully managed cloud-native database service, Azure Cosmos DB simplifies billing by charging only for provisioned throughput and consumed storage. 与本地或 IaaS 托管的替代方案相比,无需额外的许可费、硬件、使用成本或设施成本。There are no additional license fees, hardware, utility costs, or facility costs compared to on-premises or IaaS-hosted alternatives. 若想使用 Azure Cosmos DB 的多区域功能,与现有本地或 IaaS 解决方案相比,数据库服务可显着降低成本。When you consider the multi region capabilities of Azure Cosmos DB, the database service provides a substantial reduction in costs compared to existing on-premises or IaaS solutions.

使用 Azure Cosmos DB 时,需根据预配的吞吐量和使用的存储按小时付费。With Azure Cosmos DB, you are billed hourly based on the provisioned throughput and the consumed storage. 对于预配的吞吐量,计费单位为每小时 100 RU/秒,每小时收取 0.051 元(假定为标准公开定价),请参阅定价页面For the provisioned throughput, the unit for billing is 100 RU/sec per hour, charged at CNY0.051 per hour, assuming standard public pricing, see the Pricing page. 对于消耗的存储,每月每 1 GB 存储收取 2.576 元,请参阅定价页面For the consumed storage, you are billed CNY2.576 per 1 GB of storage per month, see the Pricing page.

本文通过一些示例来帮助你了解每月帐单上的详细信息。This article uses some examples to help you understand the details you see on the monthly bill. 若存在以下情况,则示例中显示的数字可能会有所不同:Azure Cosmos 容器预配的吞吐量不同;容器跨多个区域;或在一个月内在不同时期运行。The numbers shown in the examples may be different if your Azure Cosmos containers have a different amount of throughput provisioned, if they span across multiple regions or run for a different for a period over a month.

备注

计费按每个小时计算,而不是按 60 分钟的持续时间计算。Billing is for any portion of a wall-clock hour, not a 60 minute duration.

计费示例Billing examples

计费示例 – 容器上的吞吐量(整月)Billing example - throughput on a container (full month)

  • 假设在容器上配置了 1,000 RU/秒的吞吐量,且在该月总共存在 24 小时* 31 天 = 744 小时。Let's assume you configure a throughput of 1,000 RU/sec on a container, and it exists for 24 hours * 31 days for the month = 744 hours total.

  • 容器每小时存在的 1,000 RU/秒是 10 个每小时 100 RU/秒(即 1,000/100 = 10)。1,000 RU/sec is 10 units of 100 RU/sec per hour for each hour the containers exists (that is, 1,000/100 = 10).

  • 以每小时 10 个单位乘以成本 0.051 元(每小时每 100 RU/秒)= 每小时 0.51 元。Multiplying 10 units per hour by the cost of CNY0.051 (per 100 RU/sec per hour) = CNY0.51 per hour.

  • 以每小时 0.51 元乘以当月的小时数,即 0.51 * 24 小时 * 31 天 = 当月 610.1 元。Multiplying the CNY0.51 per hour by the number of hours in the month equals CNY0.51 * 24 hours * 31 days = CNY610.1 for the month.

  • 月度总帐单将显示 7,440 个单位(100 个 RU),费用为 610.1 元。The total monthly bill will show 7,440 units (of 100 RUs), which will cost CNY610.1.

计费示例 – 容器上的吞吐量(不足一个月)Billing example - throughput on a container (partial month)

  • 假设创建一个预配吞吐量为 2,500 RU/秒的容器。容器在一个月内存在 24 小时(例如,在创建容器后 24 小时将其删除)。Let's assume we create a container with provisioned throughput of 2,500 RU/sec. The container lives for 24 hours over the month (for example, we delete it 24 hours after we create it).

  • 则帐单上会显示 600 个单位(2,500 RU/秒/100 RU/秒/单位* 24小时)。Then we'll see 600 units on the bill (2,500 RU/sec / 100 RU/sec/unit * 24 hours). 费用为 30.6 元(600 个单位 * 0.051 元/单位)。The cost will be CNY30.6 (600 units * CNY0.051/unit).

  • 当月总帐单将为 30.6 元。Total bill for the month will be CNY30.6.

存储大小变化时的计费率Billing rate if storage size changes

存储容量按一个月内每小时的最大数据存储量(以 GB 为单位)计费。Storage capacity is billed in units of the maximum hourly amount of data stored, in GB, over a monthly period. 例如,如果前半个月使用了 100 GB 的存储空间,而后半个月使用了 50 GB 的存储空间,则该月将按 75 GB 的等效存储空间进行计费。For example, if you utilized 100 GB of storage for half of the month and 50 GB for the second half of the month, you would be billed for an equivalent of 75 GB of storage during that month.

容器或一组容器活动时间在一小时内的计费率Billing rate when container or a set of containers are active for less than an hour

将对容器或数据库存在的每小时按统一费率进行收费,而无论使用量是多少,也无论容器或数据库使用时间是否不足一个小时。You're billed the flat rate for each hour the container or database exists, no matter the usage or if the container or database is active for less than an hour. 例如,如果创建一个容器或数据库,然后在 5 分钟后删除它,那么帐单显示 1 个小时的费用。For example, if you create a container or database and delete it 5 minutes later, your bill will include one hour.

容器或数据库上的吞吐量扩展/缩减时的计费率Billing rate when throughput on a container or database scales up/down

如果在上午 9:30 将预配的吞吐量从 400 RU/秒增加到 1,000 RU/秒,然后在上午 10:45 将预配的吞吐量重新减少到 400 RU/秒,则将收取两小时 1,000 RU/秒的费用。If you increase provisioned throughput at 9:30 AM from 400 RU/sec to 1,000 RU/sec and then lower provisioned throughput at 10:45 AM back to 400 RU/sec, you will be charged for two hours of 1,000 RU/sec.

如果在上午 9:30 将某个容器或一组容器的预配吞吐量从 100K RU/秒增加到 200K RU/秒,然后在上午 10:45 将预配的吞吐量重新减少到 100K RU/秒,则将收取两小时 200K RU/秒的费用。If you increase provisioned throughput for a container or a set of containers at 9:30 AM from 100-K RU/sec to 200-K RU/sec and then lower provisioned throughput at 10:45 AM back to 100-K RU/sec, you'll be charged for two hours of 200 K RU/sec.

计费示例:多个容器,每个容器都采用专用的预配吞吐量模式Billing example: multiple containers, each with dedicated provisioned throughput mode

  • 如果在中国东部 2 区域创建包含两个容器的 Azure Cosmos 帐户,并且这两个容器分别预配了 500 RU/秒和 700 RU/秒的吞吐量,则预配的总吞吐量将为 1,200 RU/秒。If you create an Azure Cosmos account in China East 2 with two containers with provisioned throughput of 500 RU/sec and 700 RU/sec, respectively, you would have a total provisioned throughput of 1,200 RU/sec.

  • 需支付 1,200/100 * 0.051 元 = 0.612 元/小时。You would be charged 1,200/100 * CNY0.051 = CNY0.612/hour.

  • 如果需要更改吞吐量,且每个容器的容量增加了 500 RU/秒,同时还以 20,000 RU/秒创建了新的无限容器,则预配的总体容量为 22,200 RU/秒(1,000 RU/秒 + 1,200 RU/秒 + 20,000 RU/秒)。If your throughput needs changed, and you've increased each container's capacity by 500 RU/sec while also creating a new unlimited container with 20,000 RU/sec, your overall provisioned capacity would be 22,200 RU/sec (1,000 RU/sec + 1,200 RU/sec + 20,000RU/sec).

  • 此时需支付: 0.051 元 x 222 = 11.322 元/小时。Your bill would then change to: CNY0.051 x 222 = CNY11.322/hour.

  • 假设一个月为 744 小时(24 小时 * 31 天),如果 500 小时的预配吞吐量为 1,200 RU/秒,其余 244 小时的预配吞吐量为 22,200 RU/秒,则月度帐单将显示:500 x 0.984 元/小时 + 244 x 18.21元/小时 = 13402.56 元/月。In a month of 744 hours (24 hours * 31 days), if for 500 hours provisioned throughput was 1,200 RU/sec and for the remaining 244 hours provisioned throughput was 22,200 RU/sec, your monthly bill shows: 500 x CNY0.984/hour + 244 x CNY18.21/hour = CNY13402.56/month.

计费示例:具有共享吞吐量模式的容器Billing example: containers with shared throughput mode

  • 如果在中国东部 2 区域创建包含两个 Azure Cosmos 数据库(其中含有一组在数据库级别共享吞吐量的容器)的 Azure Cosmos 帐户,并且这两个容器分别预配了 50K RU/秒和 70K RU/秒的吞吐量,则预配的总吞吐量将为 120K RU/秒。If you create an Azure Cosmos account in China East 2 with two Azure Cosmos databases (with a set of containers sharing the throughput at the database level) with the provisioned throughput of 50-K RU/sec and 70-K RU/sec, respectively, you would have a total provisioned throughput of 120 K RU/sec.

  • 需支付 1200 x 0.051 元 = 61.2 元/小时。You would be charged 1200 x CNY0.051 = CNY61.2/hour.

  • 如果需要更改吞吐量,且每个数据库的预配吞吐量增加了 10K RU/秒,同时还向第一个数据库添加了新容器,共享吞吐量数据库的专用吞吐量模式为 15K RU /秒,则预配的总体容量为 155K RU/秒(60K RU/秒 + 80K RU/秒 + 15K RU/秒)。If your throughput needs changed and you increased each database's provisioned throughput by 10K RU/sec for each database, and you add a new container to the first database with dedicated throughput mode of 15-K RU/sec to your shared throughput database, your overall provisioned capacity would be 155-K RU/sec (60 K RU/sec + 80 K RU/sec + 15 K RU/sec).

  • 此时需支付:1,550 * 0.051 元 = 79.05元/小时。Your bill would then change to: 1,550 * CNY0.051 = CNY79.05/hour.

  • 假设一个月为 744 小时,如果 300 小时的预配吞吐量为 120K RU/秒,其余 444 小时的预配吞吐量为 155K RU/秒,则月度帐单将显示:300 x 61.2元/小时 + 444 x 79.05元/小时 = 18,360 元+ 35,098.2 元 = 53,458.2 元/月。In a month of 744 hours, if for 300 hours provisioned throughput was 120-K RU/sec and for the remaining 444 hours provisioned throughput was 155-K RU/sec, your monthly bill will show: 300 x CNY61.2/hour + 444 x CNY79.05/hour = CNY18,360 + CNY35,098.2 = CNY53,458.2/month.

采用异地复制和多主数据库的计费示例Billing examples with geo-replication and multi-master

可随时向 Azure Cosmos 数据库帐户添加/删除中国 Azure 区域。You can add/remove Azure regions anywhere in China to your Azure Cosmos database account at any time. 对于为不同 Azure Cosmos 数据库和容器配置的吞吐量,可在与 Azure Cosmos 数据库帐户关联的每个 Azure 区域中保留这些吞吐量。The throughput that you have configured for various Azure Cosmos databases and containers will be reserved in each of the Azure regions associated with your Azure Cosmos database account. 如果在 Azure Cosmos 数据库帐户(按小时配置)中的所有数据库和容器中配置的总预配吞吐量(RU /秒)为 T,而与数据库帐户关联的 Azure 区域数为 N,则对于 Azure Cosmos 数据库帐户而言,在给定时间内(小时)总预配吞吐量分别为:(a) 配置了单个写入区域时,总吞吐量 = T x N RU/秒;(b) 配置了所有能够处理写入的区域时,总吞吐量 = T x (N + 1) RU/每秒。If the sum of provisioned throughput (RU/sec) configured across all the databases and containers within your Azure Cosmos database account (provisioned per hour) is T and the number of Azure regions associated with your database account is N, then the total provisioned throughput for a given hour, for your Azure Cosmos database account, (a) configured with a single write region is equal to T x N RU/sec and (b) configured with all regions capable of processing writes is equal to T x (N+1) RU/sec, respectively. 预配吞吐量(单个写入区域)每 100 RU/秒的费用为 0.051 元/小时,对于多个写入区域(配置多主数据库),每 100 RU/秒的费用为 0.102 元/小时(参阅定价页面)。Provisioned throughput (single write region) costs CNY0.051/hour per 100 RU/sec and provisioned throughput with multiple writable regions (multi-master config) costs CNY0.102/per hour per 100 RU/sec (see the Pricing page). 无论是单个写入区域还是多个写入区域,Azure Cosmos DB 都支持从任何区域读取数据。Whether its single write region, or multiple write regions, Azure Cosmos DB allows you to read data from any region.

计费示例:多区域 Azure Cosmos 帐户,单个区域写入Billing example: multi-region Azure Cosmos account, single region writes

假定存在位于中国北部的 Azure Cosmos 容器。Let's assume you have an Azure Cosmos container in China North. 创建容器时,指定的吞吐量为 10K RU/秒,本月可存储 1 TB 的数据。The container is created with throughput 10K RU/sec and you store 1 TB of data this month. 假定向 Azure Cosmos 帐户添加 3 个区域(中国东部、中国北部 2 和中国东部 2),每个区域都具有相同的存储和吞吐量。Let's assume you add three regions (China East, China North 2, and China East 2) to your Azure Cosmos account, each with the same storage and throughput. 则月度帐单为(假定一个月 31 天)。Your total monthly bill will be (assuming 31 days in a month). 帐单情况如下:Your bill would be as follows:

项目Item 使用情况(月)Usage (month) 费率Rate 每月成本Monthly Cost
中国北部容器的吞吐量帐单Throughput bill for container in China North 10K RU/秒 * 24 * 3110K RU/sec * 24 * 31 每 100 RU/秒每小时 0.051 元CNY0.051 per 100 RU/sec per hour 3,794.4 元CNY3,794.4
3 个其他区域 - 中国东部、中国北部 2 和中国东部 2 的吞吐量帐单Throughput bill for 3 additional regions - China East, China North 2, and China East 2 3 * 10K RU/秒 * 24 * 313 * 10K RU/sec * 24 * 31 每 100 RU/秒每小时 0.051 元CNY0.051 per 100 RU/sec per hour 11,383.2 元CNY11,383.2
中国北部容器的存储帐单Storage bill for container in China North 250 GB250 GB 2.576 元/GBCNY2.576/GB 644 元CNY644
3 个其他区域 - 中国东部、中国北部 2 和中国东部 2 的存储帐单Storage bill for 3 additional regions - China East, China North 2, and China East 2 3 * 250 GB3 * 250 GB 2.576 元/GBCNY2.576/GB 1,932 元CNY1,932
总计Total 17,753.6 元CNY17,753.6

此外,假定每月从中国北部的容器中传出 100 GB 数据,将数据复制到中国东部、中国北部 2 和中国东部 2。则需要按数据传输速率为导出部分付费。Let's also assume that you egress 100 GB of data every month from the container in China North to replicate data into China East, China North 2, and China East 2. You're billed for egress as per data transfer rates.

计费示例:多区域 Azure Cosmos 帐户,多个区域写入Billing example: multi-region Azure Cosmos account, multi region writes

假定创建位于中国北部的 Azure Cosmos 容器。Let's assume you create an Azure Cosmos container in China North. 创建容器时,指定的吞吐量为 10K RU/秒,本月可存储 1 TB 的数据。The container is created with throughput 10K RU/sec and you store 1 TB of data this month. 假定添加 3 个区域(中国东部、中国北部 2 和中国东部 2),每个区域的存储和吞吐量都相同,并且你希望能够写入到与 Azure Cosmos 帐户关联的所有区域中的容器。Let's assume you add three regions (China East, China North 2, and China East 2), each with the same storage and throughput and you want the ability to write to the containers in all regions associated with your Azure Cosmos account. 则月度帐单(假定一个月 31 天)情况如下:Your total monthly bill will be (assuming 31 days in a month) as follows:

项目Item 使用情况(月)Usage (month) 费率Rate 每月成本Monthly Cost
中国北部容器的吞吐量帐单(所有区域都可写入)Throughput bill for container in China North (all regions are writable) 10K RU/秒 * 24 * 3110K RU/sec * 24 * 31 每 100 RU/秒每小时 0.102 元CNY0.102 per 100 RU/sec per hour 7589 元CNY7589
3 个其他区域 - 中国东部、中国北部 2 和中国东部 2(所有区域均可写入)的吞吐量帐单Throughput bill for 3 additional regions - China East, China North 2, and China East 2 (all regions are writable) (3 + 1) * 10K RU/秒 * 24 * 31(3 + 1) * 10K RU/sec * 24 * 31 每 100 RU/秒每小时 0.102 元CNY0.102 per 100 RU/sec per hour 30,355.2 元CNY30,355.2
中国北部容器的存储帐单Storage bill for container in China North 250 GB250 GB 2.576 元/GBCNY2.576/GB 644 元CNY644
3 个其他区域 - 中国东部、中国北部 2 和中国东部 2 的存储帐单Storage bill for 3 additional regions - China East, China North 2, and China East 2 3 * 250 GB3 * 250 GB 2.576 元/GBCNY2.576/GB 1,932 元CNY1,932
总计Total 40,520.2 元CNY40,520.2

此外,假定每月从中国北部的容器中传出 100 GB 数据,将数据复制到中国东部、中国北部 2 和中国东部 2。则需要按数据传输速率为导出部分付费。Let's also assume that you egress 100 GB of data every month from the container in China North to replicate data into China East, China North 2, and China East 2. You're billed for egress as per data transfer rates.

计费示例:包含多主数据库的 Azure Cosmos 帐户,数据库级别的吞吐量包括某些容器的专用吞吐量模式Billing example: Azure Cosmos account with multi-master, database-level throughput including dedicated throughput mode for some containers

我们来看看以下示例,示例中包含一个多区域 Azure Cosmos 帐户,其中所有区域都可写入(多主数据库配置)。Let's consider the following example, where we have a multi-region Azure Cosmos account where all regions are writable (multi-master config). 为简单起见,假定存储大小保持不变,且不会更改,此处不考虑存储大小,从而简化示例。For simplicity, we will assume storage size stays constant and doesn't change and omit it here to keep the example simpler. 本月的预配吞吐量变化如下(假定一月为 31 天或 744 小时):The provisioned throughput during the month varied as follows (assuming 31 days or 744 hours):

[0-100 小时]:[0-100 hours]:

  • 创建了包含 3 个区域的 Azure Cosmos 帐户(中国北部、中国东部和中国北部 2),其中所有区域都可写入We created a three region Azure Cosmos account (China North, China East, China North 2), where all regions are writable

  • 创建共享吞吐量为 10K RU/秒的数据库 (D1)We created a database (D1) with shared throughput 10K RU/sec

  • 创建共享吞吐量为 30k RU/秒的数据库 (D2)We created a database (D2) with shared throughput 30-K RU/sec and

  • 创建专用吞吐量为 20K RU/秒的容器 (C1)We created a container (C1) with dedicated throughput 20 K RU/sec

[101-200 小时]:[101-200 hours]:

  • 将数据库 (D1) 纵向扩展到 50K RU/秒We scaled up database (D1) to 50 K RU/sec

  • 将数据库 (D2) 纵向扩展到 70K RU/秒We scaled up database (D2) to 70 K RU/sec

  • 删除容器 (C1)We deleted container (C1)

[201-300 小时]:[201-300 hours]:

  • 再次创建专用吞吐量为 20K RU/秒的容器 (C1)We created container (C1) again with dedicated throughput 20 K RU/sec

[301-400 小时]:[301-400 hours]:

  • 从 Azure Cosmos 帐户中删除 1 个区域(可写入的区域的数量现为 2 个)We removed one of the regions from Azure Cosmos account (# of writable regions is now 2)

  • 将数据库 (D1) 缩小到 10K RU/秒We scaled down database (D1) to 10K RU/sec

  • 将数据库 (D2) 纵向扩展到 80K RU/秒We scaled up database (D2) to 80 K RU/sec

  • 再次删除容器 (C1)We deleted container (C1) again

[401-500 小时]:[401-500 hours]:

  • 将数据库 (D2) 缩小到 10K RU/秒We scaled down database (D2) to 10K RU/sec

  • 再次创建专用吞吐量为 20K RU/秒的容器 (C1)We created container (C1) again with dedicated throughput 20 K RU/sec

[501-700 小时]:[501-700 hours]:

  • 将数据库 (D1) 纵向扩展到 20K RU/秒We scaled up database (D1) to 20 K RU/sec

  • 将数据库 (D2) 纵向扩展到 100K RU/秒We scaled up database (D2) to 100 K RU/sec

  • 再次删除容器 (C1)We deleted container (C1) again

[701-744 小时]:[701-744 hours]:

  • 将数据库 (D2) 缩小到 50K RU/秒We scaled down database (D2) to 50 K RU/sec

下图直观地呈现了本月 744 小时内总预配吞吐量的变化情况:Visually the changes in total provisioned throughput during 744 hours for the month are shown in the figure below:

真实示例

将按以下方式计算月度总帐单(假定一个月为 31 天/744 小时):The total monthly bill will be (assuming 31 days/744 hours in a month) will be computed as follows:

小时数Hours RU/秒RU/s 项目Item 使用时间(小时)Usage (hourly) 成本Cost
[0-100][0-100] D1:10KD1:10K
D2:30KD2:30K
C1:20KC1:20K
中国北部容器的吞吐量帐单(所有区域都可写入)Throughput bill for container in China North (all regions are writable) D1: 10K RU/sec/100 * CNY0.102 * 100 hours = CNY1,020
D2: 30 K RU/sec/100 * CNY0.102 * 100 hours = CNY3,060
C1: 20 K RU/sec/100 *CNY0.102 * 100 hours = CNY2,040
6,120 元CNY6,120
2 个其他区域的吞吐量帐单:中国东部、中国北部2(所有区域均可写入)Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (2 + 1) * (60 K RU/sec /100 * CNY0.102) * 100 hours = CNY18,360 18,360 元CNY18,360
[101-200][101-200] D1:50KD1:50K
D2:70KD2:70K
C1: --C1: --
中国北部容器的吞吐量帐单(所有区域都可写入)Throughput bill for container in China North (all regions are writable) D1: 50 K RU/sec/100 * CNY0.102 * 100 hours = CNY5,100
D2: 70 K RU/sec/100 * CNY0.102 * 100 hours = CNY7,140
12,240 元CNY12,240
2 个其他区域的吞吐量帐单:中国东部、中国北部2(所有区域均可写入)Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (2 + 1) * (120 K RU/sec /100 * CNY0.102) * 100 hours = CNY36,720 36,720 元CNY36,720
[201-300][201-300] D1:50KD1:50K
D2:70KD2:70K
C1:20KC1:20K
中国北部容器的吞吐量帐单(所有区域都可写入)Throughput bill for container in China North (all regions are writable) D1: 50 K RU/sec/100 * CNY0.102 * 100 hours = CNY5,100
D2: 70 K RU/sec/100 * CNY0.102 * 100 hours = CNY7,140
C1: 20 K RU/sec/100 *CNY0.102 * 100 hours = CNY2,040
14,280 元CNY14,280
2 个其他区域的吞吐量帐单:中国东部、中国北部2(所有区域均可写入)Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (2 + 1) * (140 K RU/sec /100 * CNY0.102) * 100 hours = CNY42,840 42,840 元CNY42,840
[301-400][301-400] D1:10KD1:10K
D2:80KD2:80K
C1: --C1: --
中国北部容器的吞吐量帐单(所有区域都可写入)Throughput bill for container in China North (all regions are writable) D1: 10K RU/sec/100 * CNY0.102 * 100 hours = CNY1,020
D2: 80 K RU/sec/100 * CNY0.102 * 100 hours = CNY8,160
9,180 元CNY9,180
2 个其他区域的吞吐量帐单:中国东部、中国北部2(所有区域均可写入)Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (1 + 1) * (90 K RU/sec /100 * CNY0.102) * 100 hours = CNY18,360 18,360 元CNY18,360
[401-500][401-500] D1:10KD1:10K
D2:10KD2:10K
C1:20KC1:20K
中国北部容器的吞吐量帐单(所有区域都可写入)Throughput bill for container in China North (all regions are writable) D1: 10K RU/sec/100 * CNY0.102 * 100 hours = CNY1,020
D2: 10K RU/sec/100 * CNY0.102 * 100 hours = CNY1,020
C1: 20 K RU/sec/100 *CNY0.102 * 100 hours = CNY2,040
4,080 元CNY4,080
2 个其他区域的吞吐量帐单:中国东部、中国北部2(所有区域均可写入)Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (1 + 1) * (40 K RU/sec /100 * CNY0.102) * 100 hours = CNY8,160 8,160 元CNY8,160
[501-700][501-700] D1:20KD1:20K
D2:100KD2:100K
C1: --C1: --
中国北部容器的吞吐量帐单(所有区域都可写入)Throughput bill for container in China North (all regions are writable) D1: 20 K RU/sec/100 * CNY0.102 * 200 hours = CNY4,080
D2: 100 K RU/sec/100 * CNY0.102 * 200 hours = CNY20,400
24,480 元CNY24,480
2 个其他区域的吞吐量帐单:中国东部、中国北部2(所有区域均可写入)Throughput bill for 2 additional regions: China East, China North 2 (all regions are writable) (1 + 1) * (120 K RU/sec /100 * CNY0.102) * 200 hours = CNY8,160 8,160 元CNY8,160
[701-744][701-744] D1:20KD1:20K
D2:50KD2:50K
C1: --C1: --
中国北部容器的吞吐量帐单(所有区域都可写入)Throughput bill for container in China North (all regions are writable) D1: 20 K RU/sec/100 *CNY0.102 * 44 hours = CNY896.7
D2: 50 K RU/sec/100 *CNY0.102 * 44 hours = CNY2,244
3,140.7 元CNY3140.7
2 个其他区域的吞吐量帐单:中国东部、中国北部2(所有区域均可写入)Throughput bill for 2 additional regions: China East, China North 2(all regions are writable) (1 + 1) * (70 K RU/sec /100 * CNY0.102) * 44 hours = CNY6,283.2‬ 6,283.2‬ 元CNY6,283.2‬
每月总成本Total Monthly Cost 212,403.9 元CNY212,403.9

免费层帐户的计费示例Billing examples with free tier accounts

使用 Azure Cosmos DB 免费层,你将在帐户中获得前 400 RU/s 免费吞吐量和 5 GB 免费存储,并在帐户级别应用。With Azure Cosmos DB free tier, you'll get the first 400 RU/s and 5 GB of storage in your account for free, applied at the account level. 超过 400 RU/s 和 5 GB 的任何吞吐量和存储都将按定价页面的常规定价费率计费。Any RU/s and storage beyond 400 RU/s and 5 GB will be billed at the regular pricing rates per the pricing page. 在账单上,你不会看到免费的 400 RU/s 和 5 GB 的费用或行项,而只会看到超过免费层涵盖范围的吞吐量和存储。On the bill, you will not see a charge or line item for the free 400 Ru/s and 5 GB, only the RU/s and storage beyond what is covered by free tier. 400 RU/s 适用于任何类型的吞吐量,包括预配吞吐量、自动缩放吞吐量和多主数据库吞吐量。The 400 RU/s applies to any type of RU/s - provisioned throughput, autoscale and multi-master.

计费示例 - 具有预配吞吐量的容器或数据库Billing example - container or database with provisioned throughput

  • 假设我们在免费层帐户中创建一个具有 400 RU/s 吞吐量和 5 GB 存储的数据库或容器。Let's suppose we create a database or container in a free tier account with 400 RU/s and 5 GB of storage.
  • 你的帐单不会显示此资源的任何费用。Your bill will not show any charge for this resource. 你的每小时和每月成本将为 0 元。Your hourly and monthly cost will be CNY0.
  • 现在,假设在同一个帐户中,我们添加了另一个具有 1000 RU/s 吞吐量和 10 GB 存储的数据库或容器。Now, let's suppose in the same account, we add another database or container with 1000 RU/s and 10 GB of storage.
  • 现在帐单将显示 1000 RU/s 吞吐量和 10 GB 存储的费用。Your bill will now show a charge for the 1000 RU/s and 10 GB of storage.

计费示例 - 具有自动缩放吞吐量的容器Billing example - container with autoscale throughput

  • 假设在免费层帐户中,我们创建一个启用自动缩放功能的容器,最大吞吐量为 4000 RU/s。Let's suppose in a free tier account, we create a container with autoscale enabled, with a maximum RU/s of 4000 RU/s. 此资源将自动在 400-4000 RU/s 吞吐量之间缩放。This resource will automatically scale between 400 RU/s - 4000 RU/s.
  • 假设在 1-10 小时内,资源的吞吐量保持在最小值 400 RU/s。Suppose in hour 1 through hour 10, the resource is at the minimum of 400 RU/s. 在第 11 小时内,该资源的吞吐量扩展到 1000 RU/s,然后在一小时内回落到 400 RU/s。During hour 11, the resource scales up to 1000 RU/s and then back down to 400 RU/s within the hour.
  • 在第 1-10 小时内,你需要支付的吞吐量费用为 0 元,因为免费层涵盖 400 RU/s。In hours 1 through 10, you will be billed CNY0 for throughput, as the 400 RU/s were covered by free tier.
  • 在第 11 小时,你需要支付 1000 RU/s - 400 RU/s = 600 RU/s 的吞吐量费用,因为这是一小时内的最大吞吐量。In hour 11, you will be billed for an effective 1000 RU/s - 400 RU/s = 600 RU/s, as this is the highest RU/s in the hour. 该小时内的吞吐量为 6 个单位的 100 RU/s,因此总吞吐量成本为 6 个单位 * 0.123 元 = 0.738 元。This will be 6 units of 100 RU/s for the hour, so the total throughput cost for the hour will be 6 units * CNY0.123 = CNY0.738.
  • 超出前 5 GB 的任何存储都将按正常存储费率计费。Any storage beyond the first 5 GB will be billed at normal storage rates.

计费示例 - 多区域单个写入区域帐户Billing example - multi-region, single write region account

  • 假设我们在免费层帐户中创建一个具有 1200 RU/s 吞吐量和 10 GB 存储的数据库或容器。Let's suppose in a free tier account, we create a database or container with 1200 RU/s and 10 GB of storage. 我们将帐户复制到 3 个区域,并且有单主数据库(单个写入区域)帐户。We replicate the account to 3 regions, and we have a single-master (single write-region) account.
  • 如果不使用免费层,我们共需要支付 3 * 1200 RU/s = 3600 RU/s 吞吐量和 3 * 10 GB = 30 GB 存储的费用。In total, without free tier, we would be billed for 3 * 1200 RU/s = 3600 RU/s and 3 * 10 GB = 30 GB of storage.
  • 使用免费层折扣后,在扣除 400 RU/s 吞吐量和 5 GB 存储后,我们需要支付 3200 RU/s(32 个单位)的有效预配吞吐量(按单个写入区域费率计算)和 25 GB 的存储费用。With the free tier discount, after removing 400 RU/s and 5 GB of storage, we will be billed for an effective 3200 RU/s (32 units) of provisioned throughput at the single write region rate and 25 GB of storage.
  • 每月 RU/s 成本为:32 个单位 * 0.051 元 * 24 小时 * 31 天 = 1,214.21 元。The monthly cost for RU/s would be: 32 units * CNY0.051 * 24 hours * 31 days = CNY1,214.21 . 每月存储成本为:25 GB * 2.576 / GB = 64.4 元。The monthly cost for storage would be: 25 GB * 2.576 / GB = CNY64.4 . 总成本将为 1,214.21 元 + 64.4 元 = 1,278.61 元。The total cost would be CNY1,214.21 + CNY64.4 = CNY1,278.61 .
  • 注意:如果各区域的吞吐量或存储单价不同,则免费层的 400 RU/s 吞吐量和 5 GB 存储将反映创建帐户所在区域的费率。Note: if the unit price for RU/s or storage differs in the regions, the free tier 400 RU/s and 5 GB will reflect the rates of the region the account was created in.

计费示例 - 多区域多主数据库(多写入区域)帐户Billing example - multi-region, multi-master (multiple write region) account

此示例反映了在 2019 年 12 月 1 日之后创建的帐户的多主数据库定价This example reflects multi-master pricing for accounts created after December 1, 2019.

  • 假设我们在免费层帐户中创建一个具有 1200 RU/s 吞吐量和 10 GB 存储的数据库或容器。Let's suppose in a free tier account, we create a database or container with 1200 RU/s and 10 GB of storage. 我们将帐户复制到 3 个区域,并且有多主数据库(多写入区域)帐户。We replicate the account to 3 regions, and we have a multi-master (multiple write region) account.
  • 如果不使用免费层,我们共需要支付 3 * 1200 RU/s = 3600 RU/s 吞吐量和 3 * 10 GB = 30 GB 存储的费用。In total, without free tier, we would be billed for 3 * 1200 RU/s = 3600 RU/s and 3 * 10 GB = 30 GB of storage.
  • 使用免费层折扣后,在扣除 400 RU/s 吞吐量和 5 GB 存储后,我们需要支付 3200 RU/s(32 个单位)的有效预配吞吐量(按多个写入区域费率计算)和 25 GB 的存储费用。With the free tier discount, after removing 400 RU/s and 5 GB of storage, we will be billed for an effective 3200 RU/s (32 units) of provisioned throughput at the multiple write region rate and 25 GB of storage.
  • 每月 RU/s 成本为:32 个单位 * 0.102 元 * 24 小时 * 31 天 = 2,428.5 元。The monthly cost for RU/s would be: 32 units * CNY0.102 * 24 hours * 31 days = CNY2,428.5 . 每月存储成本为:25 GB * 2.576 / GB = 64.4 元。The monthly cost for storage would be: 25 GB * 2.576 / GB = CNY64.4 . 总成本将为 2,428.5 元 + 64.4 元 = 2,492.9 元。The total cost would be CNY2,428.5 + CNY64.4 = CNY2,492.9 .

主动估算每月帐单Proactively estimating your monthly bill

我们来看看另一个示例,介绍希望在月末之前主动估算帐单的情况。Let's consider another example, where you want to proactively estimate your bill before the month's end. 可按如下方式估算帐单:You can estimate your bill as follows:

存储成本Storage cost

  • 平均记录大小 (KB) = 1Avg Record Size (KB) = 1
  • 记录数 = 100,000,000Number of Records = 100,000,000
  • 总存储 (GB) = 100Total Storage (GB) = 100
  • 每 GB 的月度成本 = 2.576 元Monthly cost per GB = CNY2.576
  • 预期的月度存储成本 = 257.6 元Expected Monthly Cost for Storage = CNY257.6

吞吐量成本Throughput Cost

操作类型Operation type 请求数/秒Requests/sec 平均值RU/请求Avg. RU/request 所需 RURUs needed
写入Write 100100 55 500500
读取Read 400400 11 400400

总 RU/秒:500 + 400 = 900;每小时成本:900/100 * 0.051 元 = 0.459 元;预期的月度吞吐量成本(假定每月 31 天):0.459 元 * 24 * 31 = 341.50 元Total RU/sec: 500 + 400 = 900 Hourly cost: 900/100 * CNY0.051 = CNY0.459 Expected Monthly Cost for Throughput (assuming 31 days): CNY0.459 * 24 * 31 = CNY341.50

每月总成本Total Monthly Cost

月度总成本 = 月度存储成本 + 月度吞吐量成本;月度总成本 = 257.6 元 + 341.50 元 = 599.1 元Total Monthly Cost = Monthly Cost for Storage + Monthly Cost for Throughput Total Monthly Cost = CNY257.6 + CNY341.50 = CNY599.1

区域不同定价可能有所不同。有关最新定价,请参阅定价页面Pricing may vary by region. For up-to-date pricing, see the Pricing page.

后续步骤Next Steps

接下来,可通过以下文章了解 Azure Cosmos DB 中的成本优化:Next you can proceed to learn about cost optimization in Azure Cosmos DB with the following articles: