MongoDB sharded cluster, behavior when balancer is off?

Currently using 4.2.8 community edition. Have a sharded cluster with 20+ shard nodes.

If I turn off the balancer, will inserted documents still be distributed to the correct shard nodes – assuming a good shard key has been utilized? I believe i have chosen a good hashed key, and the data seems to get distributed well already, however, I’m experiencing some slow-downs in insert speed during peak traffic.

I would like to only allow the balancer to run during scheduled times in the day to maximize my cluster’s performance but I don’t know if that means that all the inserts will just go to the primary shard and max out the disk. Can someone clarify?

Hi @Firass_Almiski,

With hash sharding the shards are assigned with pre-defined ranges , therefore collections sharded by a hash key should not get chunk moves if you don’t add/remove shards or update the keys themselves.

Therefore if the data inserted/updated is of high shard key value cardinality the inserts should hit multiple shards regardless of the balancer status.

Checkout this blog:

Are all of your collections sharded on a hash key? I wonder what chunks are getting. Move often? Could that be the sessions collection?

Best regards,
Pavel