Initial load times out MongoDB Compass


I’m using MongoDB Compass connected to Atlas (cluster of 3 shards).

As one of my collections has grown bigger (total size 10mb, average document size 116kb) the initial load (collection.find({})) has started to time out (~30 seconds).

Since I can’t change MongoDB Compass’es “initial query” when clicking the collection name it takes very long for me to hop onto the collection to start querying.

I have indexes set up for specific searches, but collection.find({}) I guess dumps all that it can.

Hi @Kim_Korte,

It has been a while since you posted this question … were you able to find a solution?

A query using db.collection.find({}) uses natural order rather than an index, but this should be the fastest way to retrieve documents. Compass only retrieves 20 documents by default, so the size of the collection should not be an issue. Your documents are also relatively small, so any timeouts are likely more related to networking issues.

If you are still experiencing this problem, can you provide more information including your specific version of MongoDB Compass and steps to reproduce? Also, what tier of Atlas cluster are you using (M?) and what are the regions for your cluster and the computer you are connecting from?


1 Like


It works better now. I was previously storing whole blobs to the MongoDB rather that changing subsets of the documents using $set. This cause my oplog to grow out of control, which in turn seemed to affect the querying in MongoDB compass. After my changes to how I store data, the initial load of the 20 posts takes only 3-5 down from ~30 seconds.

However, I still feel like this is a bit annoying. Is there anyway I can “choose what the default query is”, clicking a collection in the menu to the left in Compass? The way Compass deals with the load of the collection is locking any user iteraction out until loaded. This is very frustrating and becomes a bottleneck when I try to interact with the database.

Compass: Version 1.19.12
MongoDB Atlas: M10

To reproduce:
Store a few hundred blobs of data un-indexed and without using $set (so that oplog takes a hit). Open compass, click collection, wait until it loads.

One big difference having 5 second load time and 30, is that I’m running on a paid tier. That could be the main difference now from then. However 30 seconds is ALOT and also being locked out from user interaction in Compass as it loads is another problem.

Thanks :slight_smile:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.