Reputation: 21
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?
Upvotes: 1
Views: 112
Reputation: 59476
Yes, your data will be inserted into appropriate shard.
However, when your shard-key is properly chosen then the balancer will be idle most of the time anyway. So, I don't see any reason to disable the balancer unless you have to run some maintenance or upgrade.
Check the balancer status when you see slow-downs in insert speed during peak traffic, then you see whether the balancer could be the culprit.
There is a build-in function (thanks to @D. SM), see Schedule the Balancing Window
In some situations, particularly when your data set grows slowly and a migration can impact performance, it is useful to ensure that the balancer is active only at certain times. The following procedure specifies the activeWindow, which is the timeframe during which the balancer will be able to migrate chunks
Upvotes: 1