[SERVER-12011] Add additional fields to output of dbStats command and collStats command Created: 09/Dec/13  Updated: 06/Dec/22  Resolved: 06/Dec/16

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: William Zola Assignee: Backlog - Storage Execution Team
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution
Participants:

 Description   

The dbStats command only outputs a subset of the data that would be of interest to a DBA when diagnosing storage issues. The current fields output are:

  • fileSize: amount of disk space used
  • dataSize: amount of space used by data (Sum of datasize for all collections)
  • storageSize: sum of extents allocated for data for all collections
  • indexSize: amount of space used by indexes

Additional fields of interest would be:

  • indexStorageSize: sum of extents allocated for indexes for all collections
  • freeExtentSize: sum of extents on the free list
  • freeRecordSize: sum of records on the record free list

Both 'indexStorageSize' and 'freeRecordSize' could also be added to the output of collStats

The net effect would be to much better determine the need to compact or repair a database or collection. It would also make the results of compact visible to users



 Comments   
Comment by Eric Milkie [ 06/Dec/16 ]

These fields would be specific to MMAPv1 only, and the index sizes are already available.

Comment by Scott Hernandez (Inactive) [ 09/Dec/13 ]

These stats could be very costly since they would require walking the free lists and (possibly) paging in each item. It would also (significantly) affect memory use and cause poor caching behavior on/after each call.

It would probably be better to keep counters for these things if we wish to report them regularly since the cost to calculate them had negative effects. For example, we keep a counter for datasize and records (docs + padding - header) in the namespace details (for a collection).

Generated at Thu Feb 08 03:27:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.