r13
r13

Reputation: 117

Speed up Rails App on development env.?

I have huge Rails app on development right now, which run VERY slow on -e development. I use Mongrel as web server. Is there any way to speed up a little bit everything? Because i have to wait 3-10 sec. to reload a page. Thanks.

Upvotes: 8

Views: 4524

Answers (6)

Akshay Mohite
Akshay Mohite

Reputation: 2268

The best way to make development faster is installing gem named active_reload.

To install this gem, you can enter command,

gem install active_reload

And, in your rails project gemfile, add

gem 'active_reload'

Then, restart your server and you will find development mode much faster than it used to be.

Upvotes: 1

user65663
user65663

Reputation:

This is the answer to all of your woes:

https://github.com/thedarkone/rails-dev-boost

Upvotes: 35

rogerdpack
rogerdpack

Reputation: 66911

If you're on windows, use some mingw builds of Ruby http://rubyinstaller.org/downloads/

If you're on linux, this might be helpful for running tests

http://github.com/candlerb/snailgun/tree/master

Upvotes: 0

Louis-Mathieu Houle
Louis-Mathieu Houle

Reputation: 55

I think if you're on Vista, Mongrel has performance issues when bound to all addresses (0.0.0.0)

Bind to 127.0.0.1 or your real I.P. (mongrel -b 127.0.0.1 -p 3000 -e development) and see if it makes a difference.

Also, if you have a connection intensive software currently open, like bittorent with a lot of open connections, your network interface might reach a maximum number of connection and slow down Mongrel. Closing bittorent, then maybe even rebooting, might fix your problem.

Upvotes: 0

nitecoder
nitecoder

Reputation: 5486

Perhaps also some things need some optimising if you are taking 3-10 seconds to render an action locally.

Upvotes: 0

Ezran
Ezran

Reputation: 2847

A very simple way to get a speed boost is to turn on class caching in development mode...

In config/environments/development.rb: config.cache_classes = true

That means Rails won't reload all the models/controllers/etc. on every request, so it'll go a lot faster, but it means you have to stop/start your server to see changes to anything except views.

Upvotes: 1

Related Questions