I'm importing 28k documents into a MongoDB using the DoctrineMongoDBBundle (Symfony 2.7.4) by foreach-looping threw the source collection. Although it's working as expected, I was wondering how to optimize the performance. I discovered that importing the first 1000 only takes a blink of an eye, but the import process slows down with every flush. Does it make sense to split the source collection and import e.g. 100 at a time? How often would you flush?
Are there any best practices?
Thanks for your suggestions!