Wednesday, March 28, 2007 -
I dabble in Rails for fun - it inspires me to do what I do for SubSonic. The one MAJOR PITA however is running it on a Windows 2003 Server box (I have a nice, big, PHAT hosted box with MaximumASP. I really don't want another box running LINUX). While there are some groovy projects out there that install scripts/CGI/rewrites for you, they all seem to be toothpicks and rubber bands that most people agree is just not a good idea for more than a hobby site because it's just plain slow.
I should also add that you can implement a "masking" approach using ISAPIRewrite as well. Basically you setup a rewrite rule for a web site in IIS that hands the request off to a server (like Mongrel) running on a different port. There is a great writeup on how to do this - but try as I might I just couldn't get it to work. I've read mixed reviews on how to get this to scale properly.
Slow? What!
Rails works using CGI - basically an executable that gets run each time a request comes into a web site. Most of the frameworks out there do NOT support multi-threading, so each time a request comes in that requires anything dynamic, CGI is "instanced" and executed. If you have a lot of requests at once, this isn't really a good thing. Now some servers are built to mitigate this (Apache, Lighttpd, etc); IIS is not.
IIS doesn't like to play this way. I can't do the discussion justice, so if you'd like to know more - read Jeff Cohen's writeup here, in this great forum post (it's the 3rd one in).
My New Favorite Person: Mike Volodarsky
If you scroll to the bottom of that forum you'll find that my other favorite person, Mike Gunderloy (his book Coder To Developer changed my life) let the "cat out of the bag" that FINALLY, the IIS team has created a technical preview (aka bleeding-edge bit of software) that will *gasp* run Rails on IIS, flexxing the IIS core architecture. Essentially what it sounds like they've done is to create a "CGI pool" if you will (sort of like an ADO connection pool) that will serve up concurrent requests. Neat idea!
I don't know all the details (I can make them up I spose), but what I can glean from their post is that this implementation of the popular FastCGI engine is much, MUCH faster than most other approaches.
I followed these instructions for setting up Rails on IIS and Windows 2003 Server and I have only a few additions to make that allowed my VM Server here to work:
Wrap Up
This is really, REALLY new stuff and the IIS guys are hoping that you give them your feedback either through the forums or by commenting on the blog entry. Probably not safe to put this on a production box :) either but I would imagine that in the next 6 months we'll see a great addition to IIS 6 and 7 for all the CGI-enabled platforms out there.
I, for one, am tickled pink...
Thanks!
There are lots of teams at MS (cough Office, Windows) that DON'T "get it" (tm), but the BCL, ASP.NET, and IIS teams really do. The FastCGI support is just one example.
Thank you for the honor :) I am really happy to see that you are playing with the Ruby support - I would love to hear your feedback around the setup steps, and how things are working out for you in general.
Have you been able to get any serious RoR apps going with it?
Thanks,
Mike