简体   繁体   English

集群中的MongoDB写性能问题

[英]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. 将数据写入我们设置的MongoDB集群(1Ma​​ster,1Config,2个分片)时,我遇到一些性能问题。 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. 对于1GB的数据(800万个文档),要花费30分钟以上,而在单个节点中,相同的数据要花费8分钟。
Here are the config details of VMs: 以下是VM的配置详细信息:

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. 这将使辅助服务器在您上载数据时暂时滞后。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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