MongoDB Documentation, Release 3.0.4 Configure Behavior of Balancer Process in Sharded Clusters The balancer is a process that runs on one of the mongos instances in a cluster and ensures that chunks are evenly distributed throughout a sharded cluster. In most deployments, the default balancer configuration is sufficient for normal operation. However, administrators might need to modify balancer behavior depending on application or operational requirements. If you encounter a situation where you need to modify the behavior of the balancer, use the procedures described in this document. For conceptual information about the balancer, see Sharded Collection Balancing (page 684) and Cluster Balancer (page 684). You can schedule a window of time during which the balancer can migrate chunks, as described in the following procedures: The mongos instances use their own local timezones when respecting balancer window. The default chunk size for a sharded cluster is 64 megabytes. In most situations, the default size is appropriate for splitting and migrating chunks. For information on how chunk size affects deployments, see details, see Chunk Size (page 688). Changing the default chunk size affects chunks that are processes during migrations and auto-splits but does not retroactively affect all chunks. To configure default chunk size, see Modify Chunk Size in a Sharded Cluster (page 727). The maxSize field in the shards (page 742) collection in the config database (page 737) sets the maximum size for a shard, allowing you to control whether the balancer will migrate chunks to a shard. If mapped size 18 is above a shard’s maxSize , the balancer will not move chunks to the shard. Also, the balancer will not move chunks off an overloaded shard. This must happen manually. The maxSize value only affects the balancer’s selection of destination shards. By default, maxSize is not specified, allowing shards to consume the total amount of available space on their ma- chines if necessary. You can set maxSize both when adding a shard and once a shard is running. To set maxSize when adding a shard, set the addShard command’s maxSize parameter to the maximum size in megabytes. For example, the following command run in the mongo shell adds a shard with a maximum size of 125 megabytes: db.runCommand( { addshard : "example.net:34008", maxSize : 125 } ) To set maxSize on an existing shard, insert or update the maxSize field in the shards (page 742) collection in the config database (page 737). Set the maxSize in megabytes. 18 This value includes the mapped size of all data files including the‘‘local‘‘ and admin databases. Account for this when setting maxSize . 713 10.3. Sharded Cluster Tutorials Configure Default Chunk Size Change the Maximum Storage Size for a Given Shard Schedule a Window of Time for Balancing to Occur • Schedule the Balancing Window (page 716) • Remove a Balancing Window Schedule (page 717).