Hi all,
I currently have a collection, with multiple 15MB JSON documents stored on an M5 database.
Using the following command, It’s takes 2.5 seconds to fetch a document in dev, from my M2 primary replica (this is good).
db.my_collection.find({_id: ObjectId("123abc815c237fcd9ad50744")})
The same command however in my mock production (M5, same document, but about 10x the number of documents), is taking 2 minutes to fetch a single document!
In summary:
- In the “development” environment on the primary replica, it takes 2.5 seconds to download. (good)
- In the “production” environment on the secondary replica, it takes 2.5 seconds to download. (good)
- In the “production” environment on the primary replica, it takes 120 seconds to download. (bad)
I’m fetching the document by _id, so there shouldn’t be a delay in the time it takes to query the document.
I’m the only user currently on the system.
I can’t tell what else could be the cause.
Why am I getting this slow performance for downloading a single document in my primary replica only?