Can a MongoDB key have two arrays?

MongoDB: Can two MapReduce jobs run concurrently on a mongod process?

  • e.g: Single Mongodb node, I have two cases which will do map reduce job on mongod process, so if they will be executed concurrently? NOTE: NOT SHARDING MODE

  • Answer:

    In theory, yes. Map Reduce will yield during processing. But each mongod process only has one instance of the javascript engine. The engine (currently spidermonkey) is not thread-safe, hence the limitation. So if you run two simultaneous Map/Reduce jobs, they are going to interrupt each other constantly. This will significantly impact performance. Basically, you only get one core that will be able to run a Map / Reduce, regardless of how many jobs you throw at it. Additionally, Map / Reduce tends to fetch data that is not currently in memory. If you're doing this twice you can potentially tax your IO and that one core. So the current recommendation is not to run multiple jobs. That stated, 10gen has gone on record saying that aggregation and m/r performance are high on the features list for 1.9.x. With 1.9 already well underway, expect this answer to change over the coming weeks and months.

Gaëtan Voyer-Perrault at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.