Rails Development Server Is Slow and Takes a Long Time to Load a Simple Page

Rails server start up time is very slow with upgrade

Thanks for pitching in folks. Just now, got it resolved.
I am using turbo-sprockets-rails-4 in which preload assets is enabled by default for dev environments.

added below config in config/environments/development.rb

TurboSprockets.configure do |config|
config.preloader.enabled = false
end

now server startup time is as fast as rails3

this is mentioned in their readme itself, but missed it while skimming through

Slow localhost load running Rails and Webrick

WEBrick is doing a reverse DNS lookup on connecting IPs by default. In other words, it's trying to see if your IP address is associated with a domain name. This is unnecessary and takes too long, so you can disable it.

Open the file "l/ruby/lib/ruby/1.9.1/webrick/config.rb" and locate the line with ":DoNotReverseLookup => nil".
Change nil to true.

Enjoy!

Localhost is taking abnormally long time to load any page

Hard to give a solution based on the little information you give, so try to narrow it down. I would say that these three causes seem the most likely:

  • the database is slow. You can check this if your queries take a long time (check the logs). Perhaps you are using a slow connector (i.e. the default Ruby MySQL library), or your indexes haven't made it to your new machine.
  • Mongrel is slow. Check by starting it with Webrick and see if that's any better
  • your computer is slow. Perhaps it's running something else that's taking up CPU or memory. See your performance monitor (application to use for this differs per OS).


Related Topics



Leave a reply



Submit