RU calculation from ItemResponse
See original GitHub issueHello, we’re kind of confused by tracking the RU spent with RequestCharge
from ItemResponse
using current SDK v3, we’ve referred the documentation via here, however, in our scenario, we found our RU from reading one document is always 1…so for reading 80 items the total RU is 80…And it never changes no matter how many documents existed in our collection or if our document schema changes… Which doesn’t seem to be correct number compared to use SQL Query within azure portal.
Here is a screenshot of our code implementation and output result:
Thank you very much for your help!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Find request unit charge for a SQL query in Azure Cosmos ...
The cost of all database operations is normalized by Azure Cosmos DB and is expressed by request units (RU). Request charge is the...
Read more >Find RequestCharge when using LINQ query in ...
When I use CreateItemAsync then I get an ItemResponse which allows me to access the RequestCharge in RU and possibly log it so...
Read more >Troubleshooting Azure Cosmos DB Performance
To get the most accurate estimate for RU/s needs for your applications, you can follow the same pattern to estimate RU/s needs for...
Read more >Calculating Cosmos DB Request Units (RU ... - Maxime Rouiller
Request units are a normalized number that represents the amount of computing power (read: CPU) required to serve the request. Inserting new ...
Read more >Calculating Cosmos DB Request Units (RU) for ... - YouTube
Calculating Cosmos DB Request Units ( RU ) for CRUD and Queries · Comments2.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A point read of one item of < 1024b is literally defined as being 1 RU (1 RU per KiB or part thereof), and intentionally is not affected by amount of records etc. Perhaps you’re comparing with charges for queries? even a query that yields a single document with a basic query has a completely different set of charges - definitely strongly recommend reading the charging model docs - its the real instructions on how to best use CosmosDB.
CosmosExceptions have RU counts as a property too (one reason being if you invoke a stored proc etc., it can incur plenty cost before failing).