currently we are using standalone mongodbInstance with 2core 8gb ram.
we have planned to move to replicaSet(3Node replica) based setup to handle more number of readWrite requests.
i exported data using mongodump. Among these exported collections, some collections has size >400mb, some have 800mb.
when i import using mongorestore command, i get runtime outofmemory error.
iam trying this out on 4core8gb ram Instance.
To fix this problem , i thought that rate of which the collections are imported + replication happening at the same time can cause this issue. So i wrote a script that can restore all the collection one by one but with some delay.
The intention behind having this delay is, this delay will give sufficient time to load a collection and once loaded, the script will pause for sometime, this will allow replication to secondaryNodes.This could freeup ram while loading the nextCollection. And i have added larger delay’s for larger collections.
But even at this approach, the ram gets too low. And it takes lot of time to load all the collections due to the delay that i have set.
is there a standard way to approach this problem in mongodbReplicaSet? Please help.