Some hours ago we updated our app to use the 2.8.2 version of Meteor. Some minutes after that we noticed that methods and publications were taking much longer than usual to complete. Upon further investigation we noticed that this slowdown was coming from our Mongo Database, however, we couldn’t tell exactly where it was originating from inside the database.
We decided to rollback to the 2.7.3 version, but somehow the problem persisted. The problem ended only after we made our database redeploy by changing some of its settings. So we needed to rollback to 2.7.3 and restart the database for the problem to stop.
This is the essential of what happened. But there is one interesting detail that we noted that might be worth mentioning. By using the profiling feature from Atlas, we noticed that a lot of operations were slower than usual after the update to 2.8.2, but there was this one specifically which seemed to be way worse than all of them. It wasn’t even a problem before the update, so it didn’t even appear in the profiler before the time we deployed the update:
By looking at the log we noticed that this is simply a count of how many documents there are in the collection:
This is not optimized, specially because the collection has lots of documents, but the problem became apparent only after we updated to 2.8.2 for some reason. And it stopped after we made the rollback and restarted the database. We already optimized the code that made this query, but this won’t solve the full problem since, as I said, other operations were also slowed down significantly. This one I’ve shown was just the one which got affected the most.
After reading the 2.8.2 changelog, we noticed an item which said “Make count NOT create a cursor”. Maybe this is related? We couldn’t confirm it though.
Does anyone know why this could have possibly happened? And what could we do to safely update our app’s Meteor version, without causing issues in the database? We are currently in the 2.7.3 version and things are working, but we’d like to update to 2.8.2.
Thanks for your attention!
Any help is greatly appreciated