mongoexport performance sucks for several specific technical reasons that MongoDB doesn't make obvious. Based on real Stack Overflow threads and production experience, here's what actually kills performance and why your exports crawl at 500 docs per second on collections that should export way faster.
The Real Performance Killers
Single-Threaded Architecture: mongoexport is completely single-threaded. Even on a 16-core server, it'll max out one CPU core while the other 15 sit idle. This Stack Overflow thread shows someone waiting 12 hours to export 5.5% of a 130 million document collection. The MongoDB tools architecture never implemented parallel processing.
Terrible Memory Management: mongoexport is a memory-guzzling nightmare. With WiredTiger compression, it decompresses every fucking document into memory, does its thing, then throws it all away instead of streaming. I've watched it balloon to 14GB of RAM trying to export a collection that's 2GB compressed on disk. It's like watching someone fill up a swimming pool to wash their hands. Understanding WiredTiger storage explains why this is so inefficient.
Collection Scan Performance: Even with no query filters, mongoexport doesn't do efficient sequential reads. It performs scattered reads through WiredTiger's B-tree structure, which kills disk I/O performance. Someone with NVMe SSDs capable of 1GB/sec throughput was only getting 50MB/sec with mongoexport. The collection scanning behavior is fundamentally inefficient.
No Resume Capability: When mongoexport crashes (and it will), you start over from zero. No checkpointing, no resume functionality. Crash at 90% through your 48-hour export? You get to stare at this:
mongoexport --collection=massive_collection --out=data.json
2025-09-01T23:47:12.123+0000 connected to: mongodb://localhost/
2025-09-01T23:47:12.145+0000 exported 45372891 records
Killed
Then start over from 0 and contemplate your life choices.
Memory Usage Reality Check
Collection compression makes this worse. If your collection uses zlib compression (which is common), every document has to be decompressed during export. This happens in the same thread that's doing everything else, creating a CPU bottleneck even when your disk and network are underutilized. The compression algorithms all require CPU-intensive decompression.
Actual Numbers: A production export of a 15 million document collection (250GB on disk, compressed) required 8GB of RAM and took 18 hours. That's roughly 230 documents per second on hardware that should handle 10x that throughput.
The underlying getMore commands show the problem clearly:
command: getMore { getMore: 14338659261, collection: \"places\" }
docsExamined:5369 numYields:1337 nreturned:5369 reslen:16773797
protocol:op_query 22796ms
22.8 seconds to return 5,369 documents. That's 235 docs per second, and this was the optimized case.
Why Skip and Limit Don't Save You
The traditional workaround of using `--skip` and `--limit` to chunk exports doesn't work like you'd expect. MongoDB has to examine every document up to your skip value, so skip=10000000 means scanning 10 million documents just to start. This is a fundamental pagination limitation in MongoDB.
Skip Performance Reality:
- Skip 0: starts immediately
- Skip 1M: takes 5 minutes to start
- Skip 10M: takes 45 minutes to start
- Skip 50M: might never start
This makes parallel exports with skip/limit basically useless for large collections. Each process sits there scanning millions of documents it's going to ignore.