Chunk size many times bigger than configure chunksize (128 MB)

Hi,

I just configured a new MongoDB shard with the latest version available (6.0.4). All seems to be working as expected, but when I run the “getShardDistribution” command, the estimated data per chunk is very high, much more than the default chunksize of 128 MB.

Shard zn-stg-dn-sh0 at ...
{
  data: '23.21GiB',
  docs: 3092671,
  chunks: 10,
  'estimated data per chunk': '2.32GiB',
  'estimated docs per chunk': 309267
}
---
Shard zn-stg-dn-sh1 at ...
{
  data: '23.73GiB',
  docs: 3363251,
  chunks: 4,
  'estimated data per chunk': '5.93GiB',
  'estimated docs per chunk': 840812
}
---
Totals
{
  data: '46.95GiB',
  docs: 6455922,
  chunks: 14,
  'Shard zn-stg-dn-sh0': [
    '49.44 % data',
    '47.9 % docs in cluster',
    '7KiB avg obj size on shard'
  ],
  'Shard zn-stg-dn-sh1': [
    '50.55 % data',
    '52.09 % docs in cluster',
    '7KiB avg obj size on shard'
  ]
}

As seen in the docs, “Starting in MongoDB 6.0.3, automatic chunk splitting is not performed.”. This means that the aforementioned chunk sizes seen in my ensemble are normal?

May I do something with this or is it something that we have to worry about?

Thanks in advance!

Hey Javi,

Starting in 6.0.3, we balance by data size instead of the number of chunks. So the 128MB is now only the size of data we migrate at-a-time. So large data size per chunk is good now, as long as the data size per shard is even for the collection.

Garaudy (Sharding Product Manager)

Hi Garaudy,

thanks for your answer. I was worried about having large chunks (about 8 GB) but data is well balanced, so it seems to be working as expected.

Totals
{
  data: '121.08GiB',
  docs: 15634531,
  chunks: 27,
  'Shard zn-stg-dn-sh1': [
    '49.88 % data',
    '51.2 % docs in cluster',
    '7KiB avg obj size on shard'
  ],
  'Shard zn-stg-dn-sh0': [
    '50.11 % data',
    '48.79 % docs in cluster',
    '8KiB avg obj size on shard'
  ]
}

Closing this thread!
Thanks again.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.