How to optimize Meteor + Galaxy + Mongo Cloud?

we are using as solution for meteorjs the galaxy server with mongo cloud. The solution is pretty easy for deployment etc. But unfortunately we experience lag and delay on the server, which is much bigger than the delay in our localhost server. We also tryed to test the different meteor calls and publications with meteor-down, the data provided shows on the galaxy server up to 10 times slower response time than the localhost. So we have tryed to connect the localhost with the mongocloud - and there we have the same slow speed like on galaxy.

We updated already mongodb on mongo cloud to the version 4.0.x (latest stable release). We also put indexes everywhere where possible. We are using the Atlas M10 Instance - AWS (AWS cloud provider)

So our concern is regarding mongodb cloud with clusters. Somehow it is too slow and we don’t know how to make it faster. We are thinking that we are not the only one who is using this, but why we experience such lag in the mongodb connection? How to make it work faster? Do you have any suggestions?

You should probably make sure that the both Mongo and Meteor servers reside in the same AWS region. When the servers are physically close to each other the lag is usually smaller.

If it doesn’t work for you we (Astraload perf team) can weigh in and solve your performance issues this or another way.

2 Likes

Beside what @eluck has said M10 is one of the smallest instances, for DB. So if you have large queries or larger load you might want to consider upgrading it to a larger instance with more resources. Also check that you have properly configured oplog. Another option to increase performance would be adding Reddis Oplog, but that is a scaling improvement (guessing that you use M10 that is not the issue here).

1 Like

Hey, we actually encountered this problem on our sharded cluster running on Galaxy & Atlas.

Here’s a quick list of tasks we performed:

  • Ensure db and web app were hosted in same geographic region
  • Index all collections
  • Find collections that were causing wait times by using APM and adding this.unblock()
  • Add shard keys to each find & fetch
  • Implemented redis-oplog (made the most impact)

For context, here was our performance before these changes were made:

After:

Hope this helps

2 Likes