WiredTiger block reuse, file fragmentation and freeStorageSize
Parent: Atlas storage auto-scaling and disk reclaim via compact · Published reference · snapshot 2026-10-31
↓ Facts as markdownall context files
Source-anchored research for WiredTiger block reuse, file fragmentation and freeStorageSize. Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
How it works
- collStats.freeStorageSize reports storage available for reuse. The scale argument changes its units, and the documented field can be absent when no storage is available for reuse. (low confidence) [source]
- Compaction is best effort: block placement can prevent a file-size reduction even when reusable bytes remain. A successful command response alone does not establish that physical disk space was reclaimed. (high confidence) [source]
- A collection compact operation covers the collection and its associated indexes. Because collection storageSize excludes indexes, that single metric is insufficient to describe the operation's complete storage footprint. (medium confidence) [source]
Comparisons and alternatives
- Dropping a collection or index releases the disk space occupied by that object, unlike deleting individual documents while retaining the object's files. (high confidence) [source]
Facts and statements
- Deleting documents leaves space inside WiredTiger data files available for later reuse; it does not generally return those bytes to the operating system. Logical data reduction therefore need not reduce filesystem usage. (high confidence) [source]
- The wiredTiger.block-manager statistic named "file bytes available for reuse" measures internal reusable space in bytes; it is not a measurement of filesystem free capacity. (high confidence) [source]
- storageSize includes allocated collection storage, including unused allocation, and reflects compression; it excludes indexes. totalSize adds totalIndexSize. Comparing logical size directly with storageSize is therefore not a reliable measure of WiredTiger free blocks. (medium confidence) [source]
- WiredTiger retains blocks referenced by checkpoints. Replacing a page does not make its previous disk block reusable until the checkpoint referencing that block has been removed and checkpoint metadata has been resolved. (high confidence) [source]
- Compaction can move live blocks from a file's end into reusable blocks near its beginning, then truncate the free tail. Interior holes are therefore potential relocation destinations, even though truncation itself occurs at the file end. (high confidence) [source]
- Measure collection statistics before and after compaction and check filesystem disk usage as well. The collection statistics describe internal allocation; filesystem usage establishes whether space was actually returned. (medium confidence) [source]
- A compact operation covers both collection data and its associated indexes. A collection-only reusable-space statistic should not be treated as a complete prediction of the total bytes the operation will free. (medium confidence) [source]
- Percona's published PSMDB 6.0.14 experiment reported 306188288 reusable collection bytes before compaction, 34000896 afterward, and bytesFreed of 507662336 while inserts continued. These observations are a workload-specific example, not a universal conversion from reusable bytes to returned disk space. (low confidence) [source]
- collStats.freeStorageSize reports storage available for reuse. Treat it as an internal free-space measure, not a guarantee that compact will return that many bytes to the operating system. (medium confidence) [source]
- For a collection-level internal-free-space ratio, compare freeStorageSize with storageSize using consistent units. This ratio describes internal capacity; it does not describe where free blocks lie or guarantee a reclaimable-byte total. (medium confidence) [source]
- The WiredTiger architecture guide warns that its descriptions do not track every code change or necessarily apply to a specific release. Its compaction thresholds should not be presented as a universal MongoDB or Atlas service contract. (low confidence) [source]
Children
- WiredTiger checkpoint references and block availability (frontier)
- Collection versus index free-space accounting (frontier)
- File-tail truncation and compaction eligibility (frontier)
- WiredTiger checkpoint references and available extent lists (frontier)
- Collection versus index reusable-space accounting (frontier)
- Compaction block relocation and tail truncation (frontier)
Frontier under this node: Collection versus index free-space accounting, Collection versus index reusable-space accounting, Compaction block relocation and tail truncation, File-tail truncation and compaction eligibility, WiredTiger checkpoint references and available extent lists, WiredTiger checkpoint references and block availability