[SERVER-4018] Add option to compact command to leave in padding. Created: 04/Oct/11  Updated: 27/Oct/15  Resolved: 05/Nov/13

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

Type: Improvement Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Matt Dannenberg
Resolution: Done Votes: 9
Labels: compaction, padding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-9525 compact should preserve namespace traits Closed
related to DOCS-1456 Document that compaction removes padd... Closed
is related to SERVER-3752 padding factor overcompaction and rel... Closed
is related to SERVER-12225 Allow query filter for compact operation Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The compact command cleans up fragmentation but also eliminates any padding factor, which can have a big performance impact if you're doing a lot of writes that grow documents. It would be nice to have an option to compact to make it remove fragmentation while retaining padding. One approach would be to leave the same padding as was there previously (may not be possible if there's no way to distinguish padding from fragmentation), another would be to add the current padding factor to every document, and another would be to let the user specify what padding factor should be added to the documents.



 Comments   
Comment by auto [ 04/Nov/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-4018 new option to preservePadding while compacting
Branch: master
https://github.com/mongodb/mongo/commit/03b7aa34cb32861396d9040a91b2ff3e6f707d3f

Comment by Matt Dannenberg [ 25/Oct/13 ]

for docs:
if you have UsePowerOf2Sizes set on the collection, it will resize using PowerOf2Sizes unless the padding buffer or padding factor is passed in with the compact command

Comment by auto [ 25/Oct/13 ]

Author:

{u'username': u'dannenberg', u'name': u'matt dannenberg', u'email': u'matt.dannenberg@10gen.com'}

Message: SERVER-4018 maintain UsePowerOf2Sizing during compact
Branch: master
https://github.com/mongodb/mongo/commit/63e564c8feccae4def0de5579ffee8d7feae7075

Comment by Daniel Pasette (Inactive) [ 29/Apr/13 ]

This is partially implemented. You can currently choose an absolute number of bytes or a percentage of document size for allocation during compact.

However, when usePowerOf2Sizes is set on a collection, compact should preserve powerOf2Sizes allocation strategy during compaction itself.

Comment by James Blackburn [ 15/Jan/13 ]

Isn't this fixed: the compact command apparently now takes a paddingFactor option:
http://docs.mongodb.org/manual/reference/command/compact/

Comment by James Peter [ 12/Oct/11 ]

+1 I recently ran out of disc space on a few nodes, so increased the size of the cluster, but there's now no way to recover that extra data from the moved chunks unless I get rid of the padding factor on those nodes (which is undesirable).

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