Why would loginWithPassword run extremely slow? User click sign in button and it can take up to 10-15 sec to log the user in. And, Meteor.logout() is also very slow.
Anyone else see this issue? How can I improve performance?
Thanks
Donnie
Meteor.loginWithPassword(email, password, function (err) {
if (err) {
$('.signInMessage').text('Sign In failed. ' + err.reason);
$('.signInAlert').removeClass('alert-success').addClass('alert-danger');
$('.signInAlert').show();
return;
}
else {
var loggedInUser = Meteor.user();
Session.set('userRole',loggedInUser.role);
Router.go('home');
}
});
From my experience this is likely due to the amount of data being sent down to the client. Not sure if this is the case for you but its a good place to start.
I have the same problem. With a server running on a 1GB RAM Single Core Digital Ocean instance, it takes 34 seconds for loginWithPassword to return. I have just 5 users created in this Meteor instance. There are no subscriptions setup prior to the login so it could not be a problem with data as well. I have been trying to solve this for last 4 days and nothing seems to improve. I am running the server using MUP
My backend is connected to a Mongolab database. Will check that next,
But if any of you have a solution or ideas, your ideas are most welcome !!
The problem was latency - from my Digital Ocean server to Mongolabs running in Google Compute. I found this through Kadira - DB time was almost 20s. I moved the Meteor server to GCE and now things are zippy… Thanks