How to limit slowness due to synchronization in progress?

Hi,

Today for some reason I lost one of my node in my cluster. I passed it in hidden: true with priority 0 and relaunch the sync. Now the node is in STARTUP2 mode and I can see in the logs the sync is in progress.
Additionally, I have some queries that are slow and I think it’s due to the synchronization that is going on. Does this make sense? How can I limit this slowness due to synchronization?

I have several terabytes so the sync should take ~2 days.

Thanks.

Hi @Boow

Setting initialSyncSourceReadPreference to secondary or secondaryPreferred may help this situation.

Converting the replicaset to a sharded cluster will reduce the time for an initial sync as each shard will have a portion of the data as well as the query load.

https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.initialSyncSourceReadPreference

3 Likes

Thanks! I confirm, sync with a secondary node is better.