简体   繁体   English

MongoDB 数据库恢复耗时太长

[英]MongoDB database restoration takes too much time

I encountered with the following issue.我遇到了以下问题。 I was tasked to restore Mongo DB from a backup and I am using mongorestore.exe (on Windows OS) for it.我的任务是从备份中恢复 Mongo DB,我正在使用 mongorestore.exe(在 Windows 操作系统上)。 Restoration process takes about 1,5h, a backup file size is about 25G (contains 25M documents).恢复过程大约需要1,5h,一个备份文件大小约为25G(包含25M文件)。

I tried to restore both on an AWS Document DB cluster (instance type: db.r5.large) and on locally installed MongoDB (EC2-instance, r5n.large).我尝试在 AWS Document 数据库集群(实例类型:db.r5.large)和本地安装的 MongoDB(EC2-instance,r5n.large)上进行恢复。 I got almost the same time of the process (about 1.5h)我得到了几乎相同的过程时间(大约 1.5 小时)

My question: Is it reasonable time for this operation and how can I optimize/reduce time that needs for this?我的问题:此操作的时间是否合理,我如何优化/减少此操作所需的时间?

All advice is very appreciated.非常感谢所有建议。

Agree with Ayoub@, parallelizing with --numParallelCollections has helped many folks speed up the restore process.同意 Ayoub@,与 --numParallelCollections 并行化帮助许多人加快了恢复过程。 Also, you can additionally speed up the restore by scaling up the Amazon DocumentDB instance to a larger size for the duration of the restore and scale it back down to an r5.large when the restore is complete.此外,您还可以通过在还原期间将 Amazon DocumentDB 实例扩展到更大的大小来进一步加快还原速度,并在还原完成后将其缩小到 r5.large。 Amazon DocumentDB charges by the second for instance costs to help minimize costs for these scenarios. Amazon DocumentDB 按实例成本按秒收费,以帮助最大限度地降低这些场景的成本。

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

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