Remote Mongo Server MUCH slower than localhost


I have some hefty subscriptions which can take some time locally. However, I’ve found on a remote MongoDB Server on AWS that this can be even 10x slower. I wouldn’t expect this much of a drop in speed.

The Meteor Server is on Heroku and this connects to the MONGO_URI on a remote AWS machine.

Any ideas on how to speed things up? I’m looking for a short config based fix. I.e. Upgrading Mongo Server, etc…

It’s hard to tell with this little information, most likely the issue here is either indexing (e.g., you don’t have one in your remote env and do locally), latency (which regions are your heroku and aws servers located) or plain performance. If you’re developing on a powerful machine locally and are now on a cheap/free config remote, that could cause problems

To help further we’d need to see the query and size of the dataset being operated over. Calling explain on the cursor in the mongo she’ll can be very helpful. Comparing the results locally and remote would help