Ryan Grow
2010-Mar-22 14:59 UTC
How to debug and profile rails library code ( in windows )
Hi, I have a project on windows using rails 2.3.5, ruby 1.8.6, mysql 5.0.28, and mysql gem 2.8.1. I am trying to debug a problem where it seems like each rails thread hangs before it has the chance to release the db connection to the pool. When the number of active connections reaches the total number available in the pool, the next request times out for five seconds before getting processed. I have tried many things to identify what is causing this problem and now I think I need to run profiling and/or debugging inside the rails code to find out where it is hanging. (For example - I''ve gotten rid of database session stores to see if that was the cause, as older posts have indicated.) How do I configure my project which currently has gems installed for rails to use source code so I can edit and debug it? Thanks, Ryan -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Luke Pearce
2010-Mar-22 15:57 UTC
Re: How to debug and profile rails library code ( in windows )
> How do I configure my project which currently has gems installed for > rails to use source code so I can edit and debug it?I assume you''re debugging anyways: http://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-ruby-debug If you do that you can step out into the rails code to see what''s happening. If you want to actually put debug lines into rails source code then how about freezing the rails gems into your project? Then you could edit them and step out at any point you like. Cheers Luke -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ryan Grow
2010-Mar-22 17:30 UTC
Re: How to debug and profile rails library code ( in windows )
Thanks Luke - freezing the gems is what I need because I am embedding ruby profile calls in there. However, now I''m trying to add the profiling inside mongrel, because the profiling I added in ActionController::Base.process did not show me where the delay is occurring. I did an unpack of mongrel and copied it to vendor along with adding the profiling code, but I''m unable to get the vendor version of mongrel_rails to execute when I run the script\server. How do I get the mongrel_rails executable in vendor override the one in path? thanks!> >> How do I configure my project which currently has gems installed for >> rails to use source code so I can edit and debug it? > > I assume you''re debugging anyways: > > http://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-ruby-debug > > If you do that you can step out into the rails code to see what''s > happening. If you want to actually put debug lines into rails source > code then how about freezing the rails gems into your project? Then you > could edit them and step out at any point you like. > > Cheers > Luke-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Luke Pearce
2010-Mar-23 00:22 UTC
Re: How to debug and profile rails library code ( in windows )
Keeping it simple - you could just rename the one in your ruby bin directory or uninstall the mongrel gem! :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.