views:

114

answers:

3

I'm using the popular restful authentication app/tutorial found here: http://railsforum.com/viewtopic.php?pid=74245#p74245

I have been using the app extensively and everything works great. The only issue that I'm having is that it takes anywhere from 60 seconds to several minutes for the system to process the creation of a new user. This is obviously unacceptable.

When I create a user through the normal signup process, the system just sits and processes for a long time and then ultimately returns a successful registration message.

I'm not getting any errors or exceptions thrown. The log doesn't indicate that anything is wrong either. I've used the app extensively for a few days now and this is the single only problem that I seem to be having with it.

Any ideas where I should be looking for the cause of this problem? The entire app is listed at the link I pasted in the top of this post, so I think it's easier to take a look at it over there, rather than me pasting in a mountain of details. I'm happy to provide answers to questions if you need more info.

Thanks!

+4  A: 

I'd use the newrelic gem (don't worry, using it for the development environment is 100% free). With this installed, you can register a user and then use newrelic to see how long each sql query took and what part of the request (rendering, etc.) is eating up the time.

If I had to make a wild guess, I'd blame the mailer configuration, but that's a shot in the dark. newrelic should help you track down where the biggest time sinks are -and if there's a big jump in time between items in the newrelic report, that's a good indicator of where something is going wrong as well.

Good luck.

semanticart
Thanks. I'll try this.
MikeH
I agree - and the mailer configuration also sounds like a really likely candidate for problems.
Barry Hess
I will also add to the chorus of people blaming what is probably an ActionMailer timeout.
MattC
It was the mailer. I couldn't get it working on my local machine, but it works fine on the server where I have a mail server properly configured.
MikeH
A: 

I would also try using Rack::Bug gem. Gives you a lot of information regarding your app that may help you debug your authentication process.

http://www.brynary.com/RackBug.mov

mike_wags
+1  A: 

I also suspect ActionMailer, if it can't contact the configured server it will take quite a while to timeout.

Another similar issue which I had a few years ago was that I was using code that used /dev/random to get random data but the virtual machine I was running on had no /dev/random but somehow it eventually would complete a request but it took forever.

peku