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.


Comments

Leave a response

  1. Avatar
    Sabon Wed, 09 Jul 2008 21:39:08 GMT
    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 Thu, 10 Jul 2008 06:13:25 GMT
    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 Thu, 10 Jul 2008 08:19:37 GMT
    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 Sat, 12 Jul 2008 05:03:45 GMT
    Switch to Linux, that's the only recommended solution. I use Ubuntu. It's proving the best.
  5. Avatar
    Pieter Sat, 12 Jul 2008 07:55:44 GMT
    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 Sat, 12 Jul 2008 07:55:48 GMT
    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 Sun, 13 Jul 2008 18:56:09 GMT
    Guys, I do use ubuntu when I can, when I have to use Vista though, this does help. P
  8. Avatar
    Paul Marsh Mon, 14 Jul 2008 19:11:44 GMT
    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 Thu, 17 Jul 2008 07:57:56 GMT
    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 Mon, 21 Jul 2008 20:59:25 GMT
    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 Mon, 21 Jul 2008 20:59:49 GMT
    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 Mon, 21 Jul 2008 20:59:58 GMT
    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 Mon, 21 Jul 2008 21:01:14 GMT
    sorry for the multiple posts.... blame my fat fingers and MS windows. :-)
  14. Avatar
    Philip Steiner Thu, 07 Aug 2008 03:51:46 GMT
    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!
Comments