简体   繁体   中英

MongoDB Write performance issue in Cluster

I am facing some performance issue while writing the data into MongoDB cluster(1Master,1Config , 2 Shards) that we have set. For 1GB of data(8 Million documents) it is taking more than 30 min while in single node it was taking 8min for that same data.
Here are the config details of VMs:

Master  Server – 7GB RAM, 3CPUs.
Config Server    -  1GB RAM, 1CPU.
2 Shard servers-  2GB RAM, 2 CPUs (each shard)

All servers configured in Virtual Machines.

Please let me know if you have any idea to resolve this issue.

It seems your secondary servers are struggling to keep up with the data writes on the primary, most likely because the have a lower hardware spec. If it is acceptable, you should set the write concern to:

{ w: 1,j: 1}

This will allow the secondary servers to temporarily lag behind while you are uploading the data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM