Meteor.users Collection - Slow Retrieval Time from MongoDB Atlas

For testing purposes for new code, I have been running my app locally and connecting to a test database on MongoDB Atlas. I have noticed this week that retrieving the Meteor.users Collection is extremely slow. To test I have done the follow:

  • Run app locally with local database: speed OK
  • Accessed Meteor.users Collection in MongoDB Compass: SLOW
  • Run code on a different computer and network: SLOW

Any ideas I can use for troubleshooting or solving the issue?


Are you using Atlas on a shared plan, ie the M0, M2 or M5 clusters? On M2 and M5 in the past I have experienced periods of poor performance, such periods starting rather randomly. Probably due to other users consuming up the shared resources. After switching to a dedicated cluster, the M10, have had no such issues, runs nice and fast.

This is not to say that your issues are definitely the same as mine.

Thanks for the reply. Indeed I am using the M0 sandbox. What is odd to me is that there are other collections in the database that have more documents and are larger that return more quickly. It is odd to me that the users collection seems to be the one plagued with the issue

No idea if this is related, but the only time I had trouble with a collection (even locally) was a missing index. How are you retrieving the Meteor.users collection and how many records does it have?

1 Like

@jamgold, thanks for the reply. Your question got me thinking cause the collection has only 18 documents. But overall size seemed very large, which made me wonder what could be using so much space. Well, we use a third party bootstrap template. This has a image selection widget that we use to allow non-facebook users to select an avatar.That ends up storing the image as base64. After we added enough test users it just got to be too much.

I removed the fields with the base64 of the 11 records where it was present and viola! Problem solved.

Thanks for your feedback as it was helpful.

1 Like