Jonas Stawski February 2016

Understanding the x-ms-resource-usage in DocumentDB response header

While performing a simple Get operation by Id where a single document is returned (not an array with one document) I get the following x-ms-resource-usage:



  • Why is documentSize 0?
  • What is the unit of measure? Bytes?
  • What is the difference between documentSize and documentsSize? Please note the query only returns one document.
  • What is the collectionSize? Is that the total number of documents in the collection?
  • What is the difference between x-ms-resource-usage and x-ms-resource-quota?


David Makogon February 2016

I'm fairly sure the numbers are as follows, and all in KB:

  • documentSize: Size of the document
  • documentsSize: Combined size of all documents in collection
  • collectionSize: Combined size of all documents in collection, along with overhead such as indexes

x-ms-resource-usage is about consumed resources within the collection, while x-ms-resource-quota is going to give you your limits. So with quota, you'll see documentsSize and collectionSize both set to something like 10485760, which is 10GB (10,485,760 MB).

Post Status

Asked in February 2016
Viewed 3,477 times
Voted 4
Answered 1 times


Leave an answer