Search

 


Yeah, right!

Speed up slow Rails development in vista 14

Posted by Paul McConnon Tue, 01 Jul 2008 23:22:00 GMT

I’ve been doing rails development on a Vista box recently and was annoyed by how slow script/server (running mongrel) was to respond.

I am aware that Windows is slower in general for running ruby / rails but this was slooooooow.

I normally start rails development server with the standard ‘ruby script/server’ command…

C:\blah> ruby script\server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
...

Notice that mongrel binds to 0.0.0.0 (as far as I remember, it used to bind to 127.0.0.1). This does work. But it is very slow, so I tried changing it to bind to 127.0.0.1

C:\blah> ruby script\server -b 127.0.0.1
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://127.0.0.1:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 127.0.0.1:3000
** Starting Rails with development environment...
...

And guess what, a subjective 300-400% increase in responsiveness. This makes the whole development process much more pleasant.

Hope this helps someone.