简体   繁体   中英

Why is my connection super slow on MongoDB Atlas vs local

When using MondgoDB Atlas with Node, I find that the connection and queries are running extremely slow (Taking several seconds). I've tried shared, serverless and dedicated setups with the same result. When I use my local MongoDB setup however, everything runs super smooth and my queries are fast as expected (my query is a simple insert).

Is this common? Is there a reason that the hosted connection runs super slow whereas my local runs fast? I'm not behind any firewall.

The region where your MongoDB Atlas is located will also affect the connection quality.

Choose a closer region .

Mongodb local is in your pc and so it will be ofcourse faster than Atlas, and Atlas is in a server which may take more time to read/ write than local setup. Mongodb Atlas do read /write in milliseconds, but it may vary depending on your query.

Where you calling Mongodb requests from?Mongodbcli or a server or a client side application?

If it's taking more than 1 second you should check your inte.net speed, query optimization

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