Compact MongoDB

Our Compact tool allows you to defragment and reduce the size of your data files by rewriting all the documents and indexes in a collection to contiguous blocks of disk space. If you have a replica set for your ScaleGrid hosting for MongoDB® deployment, the compact operation performs a rolling upgrade resulting in almost no downtime for your deployment.

🚧

Compact during times of low load

We recommend running the compaction only at times of low load, as it takes a significant amount of time per server.

Compact Your MongoDB Cluster

Here are the steps to start an automated compact operation for your MongoDB cluster:

  1. Login to the ScaleGrid console.
  2. Go to your cluster details page for MongoDB®, and select the cluster you wish to compact.
  3. Click on the 'Compact' button under the 'Overview' tab of your MongoDB® cluster details page.
  4. Click the green 'Compact' button to begin the compact operation for your MongoDB® cluster.

Learn more about the MongoDB® compact operation in our blog post:
Understanding and Managing Disk Space on Your MongoDB Server