26

Our rails app is nice and fast once it is loaded but the startup is brutally slow. Console, passenger etc all take almost 10 seconds to kick in. Seems to be way more than it should be.

What tools or methods should I use to hone in on the slowest parts? What are the usual suspects?

chrishomer
  • 4,900
  • 5
  • 38
  • 52
  • Is it taking 10 seconds even in _production_ mode? – JellicleCat Apr 12 '11 at 17:27
  • What kind of memory footprint is the app making during startup? There is always warmup time to cache classes and open db connection on the first few seconds as requests come in. If you are maxed out on ram or cpu this will take longer and suggest you need a more powerful box. Also are you using passenger? How many processes do you have configured for max? – Wes Apr 13 '11 at 04:57
  • Using passenger. Considering a switch to unicorn though. Not maxed out on memory. It's a fairly big app but it seems crazy long on startup. A new app on my machine boots in 2-3 seconds. This is between 10 and 15 seconds. Maybe 10 seconds in production and 15 seconds in dev? Runs fast per request once it's up. Just brutal boot times. – chrishomer Apr 13 '11 at 15:48

1 Answers1

18

I know this is an old question but I recently had an issue with load times and this is my fork of gem which helped me find which gems were the slowest, the good thing about this gem is that loads up with the rails console, and all the initializers are run.

https://github.com/mark-ellul/Bumbler

Mark Ellul
  • 1,906
  • 3
  • 26
  • 37
  • Mark, thanks. Looks to be helpful. Is there a way to change it so it doesn't update the same line but goes to a new line for each gem? – chrishomer Jul 28 '12 at 15:37
  • I got this error: cannot load such file -- bumbler/stats. it's still very buggy (i might be wrong). Thanks anyway – Canopus Aug 28 '12 at 03:28
  • did you install with the Gemfile? – Mark Ellul Aug 28 '12 at 15:58
  • Quite useful. Thank you. Using 1.9.3 p194 and saw some gems took up to 2 seconds to load. Right now I have no idea why, but at least this points me to the right direction. – Ramon Tayag Sep 02 '12 at 08:50