The default chunk size of 64 MB works well for 90% of the deployments you make. However, due to the server or network constraints, you might notice that automatic migrations are producing input/output (I/O) bottlenecks. If you increase the default chunk size, you experience a lower number of automatic migrations (as there is more room within each chunk, giving the balancer more leeway in its allocations); however, each migration takes more time. On the other hand, if you decrease the default chunk size, you might notice an uptick in the number of automatic migrations; however, each migration occurs more rapidly.
To change the default chunk size, proceed as follows:
- Connect to a mongos instance from a mongo shell as a user with sufficient cluster administration rights.
- Use the config database by running the following command:
use config;
- Use the save() method on the config.settings collection...