Meteor.loginWithPassword Very Slow to Respond


Hi Forum,

I’m on meteor 1.8 & Mongo 3 and trying to call Meteor.loginWithPassword, but it is taking a very very long time to return a result, like 25 seconds, and then it seems to slow down the entire meteor server afterwards until I reboot and logout the user.

The application is very bare bones. The client only subscribes to a tiny amount of data. Same data loads very quickly before logging in. After logging in the publication starts to hang and takes a very long time to respond. I’ve isolated the behavior to calling loginWithPassword(). If I skip that call everything behaves as expected.

I only have a single user account defined, so I don’t know what could be causing it to take so long. All other queries and database interactions are fast, as long as I’m not logged in.

Any ideas? Or suggestions for debugging this?


I would check if users collection has properly indexes.


Yes it has all of the indexes defined by the package.

There is also only a single user defined in the collection, so it doesn’t have much data to search through.


Have you tried using a kadira alternative, like It is free for 8h retention, and works like the original kadira with some improvements. It will catch the traces of your long running methods like the login method so you can explore which step is taking a long time.

1 Like

Thanks, I miss Kadira. I’ll check this one out.


Looking at Kadira, I can see the method response time for login is extrememly long. Here’s link the to a stack trace for the login:

You can see that the find on users takes 0ms, while the fetch on users takes 29912ms! Why is that fetch taking so long? The query it is performing is very simple and it only returns a single document.

This trace shows the observer changes call taking forever to return:


The stack trace also mentions that I’m not using OpLog support in my app. Is that a requirement?


Yes, use the oplog to solve your performance issues. There is something else wrong, but this is one of the things that are wrong.


Oplog would not be the root cause of this. It’s as if your database is on the moon, or running on a potato. How/where is your DB running?