My collection is stuck to a single chunk per shard

I’m building a POC environment for a self hosted mongoDB version 7 cluster containing 5 shard replica-sets (each containing single node), 1 config server, 1 query router and i’ve created 3 collections sharded by _id “Hashed” with 3 - 6 indexes (including text and TTL) per collection, my workload is write intensive with around 3 bn documents per day, While trying to investigate a write latency issue I noticed that all my collections are stuck at single huge chunk per shard even though I ensured that the max chunk size is 128 mb and none of them are labeled jumbo, how is that possible, I even tried to recreate my collections with 40 initial chunks per shard and it was created but when i ingested the documents, the chunks got merged to single yet huge one. 150 GB and increasing.
it would be a great help if you can help investigate and resolve this issue

Thanks in advance and best regards.

Hi Mahmoud_Elatma

Starting with MongoDB 6.0, we introduced a new sharding balancer policy based on data size rather than number of chunks. This means that chunks will only be split when they need to be moved. As a result, it’s completely expected to see only one chunk on a specific shard in certain cases.

Additionally, in MongoDB 7.0, we introduced the automerge feature, which is enabled by default. With automerge, the server can automatically merge adjacent chunks on the same shard, provided they meet the mergeability requirements. This explains why your previously split chunks may seem to “disappear” — they’re being merged automatically.

To summarize:

  • With the balancer enabled, it utilizes the data size policy to split and move chunks as needed to ensure even data distribution.
  • Once split chunks are moved and become eligible for merging, the server can automatically combine adjacent chunks on the same shard.

Since you are doing a POC for a new application I would also advise to start with the latest MongoDB 8.0 in order to take advantage of the new capabilities and performance improvements that were introduced.

If you have any further questions or need additional clarification on this topic, feel free to ask—I’d be happy to help!