Michał Jurczuk
Michał Jurczuk

Reputation: 3828

MongoDB huge bulk insert performance

I'm inserting a lot of data e.g. 1 mln documents. How should I insert them? After small tests I have a different time results for inserting all data in arrays of 500 and 1000 size (bulk). In my use case 500 is faster. Which buffer size should I use? Any suggestions?

Upvotes: 0

Views: 431

Answers (1)

Lix
Lix

Reputation: 47956

For batch inserts like the one you are talking about it would be better to use the appropriately named mongoimport command line tool.

The mongoimport tool provides a route to import content from a JSON, CSV, or TSV export created by mongoexport, or potentially, another third-party export tool...

Upvotes: 1

Related Questions