Sunday, July 16, 2006

Http.sys and Rails

I made some good progress today on my .Net web server for Rails based on Http.sys. Ultimately I want it to support a pool of ruby interpretters, URL rewriting, and serving regular files (static and dynamic (aspx)) via http.sys. I already have the basic non-Ruby file serving in place through the magic of HttpRuntime.ProcessRequest. Right now I'm working on some simple wrapper classes to handle CGI. Once I have that done, I'll add URL rewriting so I can get Rails running. The last step is the process pool, so things actually run quickly.

Initially I'm going to try using a TCP socket as a control channel where the server can signal the child process to begin working and the child can tell the server when it's done. FastCGI looks like it actually multiplexes control information along with standard input and output over the TCP. Perhaps there's a good reason for that, but I'm going to start with the server writing to and reading from the child's standard in and out directly, orchestrated by the control channel.

My goals are both to learn about Rails from a development and solution architecture perspective and to simply the process of getting a production-ready Rails server setup on Windows. Rails can definitely have a place in a real enterprise architecture, but requiring clients with Windows servers to install and maintain apache (or lighttpd, etc.) in addition to IIS is a big hurdle. Having something based on http.sys should mitigate a lot of this (unified instrumentation, etc.).


mortench said...

Very, very interesting!!

Anything new to report here?

Code Monkey said...

Not much, unfortunately. My real job has been keeping me pretty busy at the moment. Recently I've been able to justify the use of Rails for an internal project, though, so that should afford me some more time on this front.