liveBook · Manning

Request unit per second

As explained in Microsoft Azure in Action

A request unit per second is a Cosmos DB throughput capacity unit representing the number of request units a collection can serve each second.

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

How Microsoft Azure in Action covers it

How deep it goes
Defines RU/s through operation costs and worked capacity estimates, then compares provisioned throughput, autoscale limits, and pricing alternatives.
Examples
Uses a 400 RU/s collection, approximate read and query costs, and Azure CLI commands setting 1,000 RU/s or a 10,000 RU/s maximum.
What it assumes
Introduces request units through familiar read, write, and query operations and a collection-creation command.
What you can do after
Operate/configure it by choosing fixed throughput or an explicit autoscale maximum to suit expected traffic and cost limits.
How it connects
Connects RU/s to provisioned throughput, autoscale, multi-region replication, and vCore-based pricing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Microsoft Azure in Action. The section links point to the parts of the book it draws on.