I'm experiencing slow performance when testing simple queries on Mongo. Here's the context:
- A 8 vCPU, 16 GB RAM VM (ESXi) running Debian 10 / MongoDB Community Edition 4.4.1 as a standalone server.
- Debian has been configured with XFS and with the limits set to the recommended values noted here: https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings
- I have two collections, Sales Order and Quote, where the Quote collection data contains IDs for the Sales Order collection in a one-to-one relationship.
- Both collections have ~50k records and each is roughly 10MB in size according to Compass.
- Both collections' ID fields are indexed as well as the field in the Quote collection that points to the Sales Order collection.
- The database is being accessed by .NET driver which has recently been updated using NuGet.
- The server hosting MongoDB is hosted on-prem on a gigabit network.
I understand that relationships are not the focal point of the design of NoSQL databases, so here's an example that doesn't even take the join into account.
It takes 1.7 seconds just to have MongoDB bring back all ~100k documents across the two collections totaling 20MB. The amount of time to bring that much data over the wire/network is ~0.16 seconds, so it isn't a huge contributing factor.
Access 2016, a product that isn't meant for production, brings back both tables joined in less than a quarter of a second. (It takes Mongo 3.7 seconds). Now, it doesn't have to transfer the info over the wire so we can add 0.16 seconds to that, but it's still wildly off.
Considering that I've read plenty that Mongo can do some amazing things, including in the performance category, I must be doing something wrong.
What could cause the results I'm getting?