Does the embedded map / abbreviation on Mongo block contain?
In inline mode, the output is returned as a single document essentially limiting the maximum document size, so can you see a difference in behavior or response times because you are returning a larger result?
In terms of blocking, the Map / Reduce job can be thought of as many small operations (including writes).
First, there is javascript blocking, so only one thread can execute JS code at a time, so one thread at least for now. But most of the JS MR steps (like one card ()) are very short and hence blocking happens very often.
There are also several non-JavaScript operations that MapReduce does that take locks:
- It reads from the collection (read lock gave every 100 documents)
- Inserts documents into a temporary collection (write lock for one record)
- It creates the final collection or merges or replaces an existing collection (write lock)
Your built-in mode removes the second second by having it as a memory stick, so you shouldn't see write locks, at least not for this job. Could the locks be due to JS operations, or read rather than write perhaps?
source to share