I’m trying to understand the AutoSplitting behaviour of MongodB 4.4
We have recently (26/03) upgraded our sharded cluster to MongoDB 4.4 (from 4.2). After the upgrade we see that more chunks are being created (split) than before the upgrade.
The following graph shows the total amount of chunks in the sharded cluster. It increases steadily over time as data comes in. There is a flat line during the upgrade as we disabled the balancer, and after the upgrade the growth is much steeper.
The amount of data being ingested remained the same. We see that the average size per chunk decreases at the same pace.
Looking at the
changelog collection we see that 4.2 uses
multi-split where 4.4 seems to use
split. I’m unsure how to compare the 2 functions. We see about 50% more
split actions after the upgrade than we saw
multi-split actions before the upgrade.
Did something change in the splitting behaviour of 4.4 that can cause the auto-splitter to split chunks more often?
Some relevant notes:
- The maximum chunk size is set at the default setting of 64MB.
- Our shard key is monotonically increasing (based on time).
system.sessionscollection has 1024 chunks, this change doesn’t account for the increase we’re seeing.
With the new amount of chunks, the balancer seems to be overwhelmed and migrations / moves are increasingly lagging.