A request unit per second (RU/s) measures the throughput capacity available to an Azure Cosmos DB collection or database. Reads, writes, and queries each consume request units; a more complex operation generally consumes more. Setting RU/s therefore sets a capacity for a mix of operations, not a fixed number of requests. section 11.1 section 11.6.1
What 400 RU/s can serve
Suppose a collection has 400 RU/s. If a simple read of a 1 KB item costs about 1 RU, that capacity could serve about 400 such reads per second. If a filtered, sorted query costs 10 RUs or more, it could serve far fewer of those queries. The workload—not just the request count—matters. section 11.1
C:/> az cosmosdb mongodb collection create --account-name alpacacosmosdbaccount --database-name alpacacosmosdb --name alpacacontainer --resource-group AlpacaRG --shard "/alpacakey" --throughput 400
This Azure CLI command creates a MongoDB collection with a shard key and sets its throughput to 400 RU/s. section 11.1
Choose capacity with both traffic and the bill in mind:
- For steady traffic, provision a specific RU/s value. The CLI uses `--throughput`; an example sets a product-catalog database to 1,000 RU/s. section 11.6.1
- For variable traffic, autoscale adjusts throughput up to a maximum. The CLI example uses `--max-throughput 10000`; set that limit explicitly so the default does not undermine performance or cost plans. section 11.6.1 section 11.1.1
- Provisioned throughput affects cost, and autoscaling can raise costs during demand spikes. Multi-region replication can add storage and request-unit charges. For some CPU-intensive, predictable workloads, compare RU/s pricing with vCore-based pricing. section 11.1.3 section 11.6.3
