S
S
Saboteur2021-01-04 01:56:57
MongoDB
Saboteur, 2021-01-04 01:56:57

How to speed up mongodb backup-restor as much as possible?

Surprisingly, mongobackup and mongorestore are surprisingly slow.
It is necessary to transfer the database between clusters and there is no way to connect a temporary replica and there is no way to transfer files.
That is, you need to make a dump and restore it to another database without reconfiguring the databases.

Cons of mongodump - the dump on the disk takes up 2-5 times more space than the database itself.
Tried to do gzip, with place order, but it is TERRIBLY slow. I did not find how to specify the compression ratio, it seems to compress at the maximum, but it does not know how to use all the cores.

Somewhere on the Internet I kind of found that you can specify the compression ratio, but in reality it didn’t work (maybe some specific version?)
So far, as the fastest way, I found it through the pipe ( mongodump | mongorestore), run it on a machine as close as possible to the base (there is no possibility on localhost). But suddenly someone will tell you useful nuances?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question