Search

 


Time travelling into the future at a rate of 1s/s

Speed up slow Rails development in vista

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.

Tags , ,  | 14 comments

Comments

  1. Avatar Sabon said 7 days later:
    True, launching the app is way too slow on Windows. Unfortunately the speed boost doesn't work on Win XP. It's still unbearably slow with 127.0.0.1 and restarting the server (which should take a few seconds) is done only as a necessity. This makes me switch to either Linux of Mac for development.
  2. Avatar supaspoida said 8 days later:
    I recently switch over to running linux in a VM for any ruby tasks I need to do, while still using windows for editors, photoshop, etc. The speed increase was amazing, although I'm sure result vary based on the system used.
  3. Avatar Aditya Sanghi said 8 days later:
    Have you guys tried thin instead of mongrel? It doesnt really solve your problem of slow startup but i found a major boost in execution (in development mode). I'm using WinXP.
  4. Avatar Anil Wadghule said 10 days later:
    Switch to Linux, that's the only recommended solution. I use Ubuntu. It's proving the best.
  5. Avatar Pieter said 10 days later:
    Or simply switch to Linux in a VM. I use Ubuntu in VMware to run Apache with Passenger for development. You could use the opensource VM VirtualBox as well of course.
  6. Avatar Pieter said 10 days later:
    Or simply switch to Linux in a VM. I use Ubuntu in VMware to run Apache with Passenger for development. You could use the opensource VM VirtualBox as well of course.
  7. Avatar Paul said 11 days later:
    Guys, I do use ubuntu when I can, when I have to use Vista though, this does help. P
  8. Avatar Paul Marsh said 12 days later:
    Another vote for running Linux in a VM, simply setup Samba and you can use any Windows editor you'd like. Even better match your VM's OS to the OS that you plan on deploying to and everyone wins. Enjoy!
  9. Avatar Charles Roper said 15 days later:
    For those of you on Linux, what editor do you use? I'm currently using E Text Editor on the PC and would use TextMate if I had a Mac.
  10. Avatar jitterfix.com said 19 days later:
    I'm using vim on Linux Ubuntu for my new laptop. I've recently discovered the vim-rails package and am really liking it. It's a collection of vim plug ins that gives you many of the nice features that approach some of the TextMate functionality.
  11. Avatar jitterfix.com said 19 days later:
    I'm using vim on Linux Ubuntu for my new laptop. I've recently discovered the vim-rails package and am really liking it. It's a collection of vim plugins that gives you many of the nice features that approach some of the TextMate functionality.
  12. Avatar jitterfix.com said 19 days later:
    I'm using vim on Linux Ubuntu for my new laptop. I've recently discovered the vim-rails package and am really liking it. It's a collection of vim plugins that gives you many of the nice features that approach some of the TextMate functionality.
  13. Avatar jitterfix.com said 19 days later:
    sorry for the multiple posts.... blame my fat fingers and MS windows. :-)
  14. Avatar Philip Steiner said about 1 month later:
    A while back I had Ubuntu dual-booted on my Vista laptop, but I missed the spit-n-polish of Windows (yes!). I kept going back to Windows, and eventually gave up on the linux partition. But I also found Rails development on Vista painfully slow. Then a couple of weeks ago I discovered and installed andLinux (Ubuntu 7.10/KDE 3.5.x) to run my Rails development environment. The brave folks over at andLinux tweaked Linux to run as a process within Windows (no VM in there at all). Weird, but it was fairly easy to install, and it gives me the best of both worlds. I can still do my editing with jEdit from the Windows environment, by putting my Rails development files in a directory that is shared between Windows and Linux. After installing a few plugins jEdit excels as a lightweight Ruby/Rails-aware IDE. Happy happy!

(leave url/email »)

   Preview comment