Changing the default chunk size

To change the default chunk size, we need to connect to a mongos router and consequently to the config database.

Then we issue the following command to change our global chunksize to 16 MB:

> db.settings.save( { _id:"chunksize", value: 16 } )

The main reasoning behind changing chunksize comes from cases where the default chunksize of 64 MB can cause more I/O than our hardware can handle. In this case, defining a smaller chunksize will result in more frequent but less data-intensive migrations.

Changing the default chunk size has several drawbacks:

  • Creating more splits by defining a smaller chunk size cannot be undone automatically.
  • Increasing the chunk size will not force any chunk migration; instead chunks will grow through inserts and updates until they reach the new size.
  • Lowering the chunk size may take quite some time to complete.
  • Automatic splitting to comply with the new chunk size if it is lower will only happen on insert or update. We may have chunks that don't get any write operations and thus will not be changed in size.

The chunk size can be [1…, 1024] MB.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.143.32