Azure Cosmos DB - Incurred Charges on Free Tier

Justin Kim 0 Reputation points
2024-11-07T16:47:53.0866667+00:00

I incurred a charges for Cosmos DB in Free Tier.

I understand the part where RUs are free up to certain limit, but after that users can be charged. Is there way to place a hard-stop, or throttling if RUs are going above max-limit given for free-tier users?

In addition, there is an option where it made it sounds like I can place a hard-stop so that users won't incur any charges; HOWEVER, this option cannot be saved, and it doesn't give much instruction on why I can't make that selection.

Any help would be appreciated!User's image

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,691 questions
{count} votes

1 answer

Sort by: Most helpful
  1. NIKHILA NETHIKUNTA 3,590 Reputation points Microsoft Vendor
    2024-11-08T07:02:52.0233333+00:00

    @Justin Kim
    Thank you for the question and for using Microsoft Q&A platform.
    In Azure Cosmos DB's Free Tier, users are granted up to 1,000 request units per second (RUs/s) and 25 GB of storage at no cost. However, if you exceed these limits, you do indeed start incurring charges. While there isn't a hard-stop setting in Cosmos DB for throttling usage strictly within these limits, there are some workarounds and settings to help avoid unexpected charges and better control usage.

    1. Request Throttling: Azure Cosmos DB automatically enforces request throttling when usage exceeds the allocated Request Units (RUs). If your application tries to consume more RUs than the provisioned amount, the requests are rate-limited, resulting in a 429 Too Many Requests status code. This feature safeguards against unexpected costs by capping throughput at the provisioned level.
      https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/troubleshoot-dotnet-sdk-slow-request?tabs=cpu-new
    2. Application-Level Rate Limiting: You can implement rate limiting within your application to ensure that the total operations per second sent to Azure Cosmos DB don’t surpass the allocated throughput. This proactive strategy helps manage and control usage, reducing the risk of hitting limits unexpectedly.
      https://learn.microsoft.com/en-us/azure/cosmos-db/rate-limiting-requests
    3. Monitoring and Alerts: Enable monitoring and set up alerts in Azure Monitor to track RU consumption. Alerts can notify you when your usage is nearing the free tier limits, allowing you to take action to avoid additional charges.
    4. Free Tier Limitations: The free tier offers 1000 RU/s and 25 GB of storage at no cost. Exceeding these limits incurs standard charges for additional throughput or storage used. However, a built-in hard-stop feature to prevent charges once the free tier limits are exceeded is not available. https://learn.microsoft.com/en-us/azure/cosmos-db/free-tier

    Regarding the option about the total throughput limit setting for a Cosmos DB you can set a total throughput limit for your Azure Cosmos DB account to avoid unexpected charges. Once you set a limit to your account's total throughput, any operation that results in exceeding this limit is blocked and will explicitly fail. This includes creating a new database with shared throughput, creating a new container with dedicated throughput, increasing the provisioned throughput on a resource configured in standard (manual) mode, increasing the maximum provisioned throughput on a resource configured in autoscale mode, and adding a new region to your account.
    https://learn.microsoft.com/en-us/azure/cosmos-db/throughput-serverless

    While creating a Cosmos DB we have two options for the capacity mode provisioned throughput and serverless. While creating a new Cosmos DB , provisioned throughput is selected as the default option.

    User's image

    User's image

    While you select the cost management option in the Cosmos DB, the option to limit the account's total provisioned throughput is already selected. Hence you do not see the option enabled for save.

    User's image

    When you change the RU/s value in the second option from 1000 to any other value, the save button will be enabled.User's image

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.