简体   繁体   中英

Azure MongoDB find operation query time is slow

I used Robo 3T to test Azure Cosmos MongoDb and Another MongoDb has exactly same data in a VM.

I run very simple query in my local machine (Windows):

db.getCollection('PSTN_inspector_wav_data').find({})

I can control how many documents I want to get. The result is shown here.

For Azure Cosmos Mongodb:

  1. If I want to fetch 500 documents, it takes 2.135s: The capture image
  2. If I want to fetch 5000 documents, it takes 18.308s: The capture image
  3. If I want to fetch 25000 documents, it takes 84.097s: The capture image

For the mongoDb in Vm:

If I want to fetch 25000 documents, it only takes 1.448s The capture image

It seems for Azure Cosmos Mongodb , the query time has a linear relationship with the documents size.

I already checked the network, it doesn't have any problem.

So can anybody give some guess why it is slow?

In this order: 1. latency to the Azure DC 2. Auth/encryption/backup/replication layer adding overhead. If you turn all this in your local MongoDB it will be much slower too. 3. Unpartitioned (eg unscaled) collection 4. Low throughput setting (unlikely the problem here as you'd get error, but one of the things you can control with number of users growing (and you can't with standalone MongoDB).

In conclusion - don't compare community edition unhardened software process with production-ready money-backed distributed service. They're not equivalent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM