Latest News >> 2008-08-06

Well, I’ll be at DefCon this year, and I always try to do something fun for the conferences I attend.

2008-08-01

Well looks like my rant about the state of open source feed readers hit some sites, so I should put in a few clarifications so people understand what I was looking for more specifically. I’ll do it by answering several of the questions people sent me.

2008-07-20

RubyFringe was my last Ruby conference and it was the best conference to go out on. Everything about RubyFringe was great. It was well organized, contained eclectic talks, and supported the weirdness that’s usually hidden at the other conferences.

2008-06-25

I’ve been completely fed up with news/feed/rss/atom readers these days. I use Linux as my primary operating system, and I only have a few feeds that I want to rip through quick so I can get to reading the content. Yet, trying to find a reader that doesn’t suck donkey balls has been a chore.

Ruby On Rails Using SCGI

The SCGI Rails Runner (SRR) is a very small Ruby script for running Ruby On Rails for high-speed deployment of your applications in production. SRR is intended as a replacement for the ancient FastCGI code base and bring some big advantages to Rails deployment for production operations.

What’s SCGI

The Simple Common Gateway Interface is a project to replace CGI and FastCGI with a simpler protocol to both implement and manage. It was written by Neil Schemenauer and adopted by many Python developers as a hosting option. The protocol is so simple that I was able to implement a quick hack version in about an hour the first time I did it.

Getting The Goods

Here’s the quick links to the good stuff right away for those people who know exactly what they want:

Latest release is 0.4.3 released on 23 October 2005.

Advantages

The primary advantages of SCGI over FastCGI are:

  • Simultaneous support for Apache1, Apache2, and lighttpd on OSX, Linux, FreeBSD and Win32.
  • Same performance as FastCGI and better performance than other methods.
  • Is a single cross-platform Ruby script that even runs on win32 (with some restrictions).
  • Works with SCGI modules for Apache, Apache2, and Lighttpd webservers.
  • Simple to install, run, and configure.
  • Supports simplified clustering on most POSIX systems for that extra boost in concurrency.
  • Accessible via DRb (distributed Ruby) so you can create remote management systems.
  • Gives out great status information to help manage your Rails application’s resources.
  • Makes it easy to manage your production deployment, and you can even run your application in development mode exactly the same way as with script/server for extra testing efficiency.
  • It can throttle connections to reduce the load on the server.
  • You can set a maximum concurrent connections limit, which causes any connections over the limit to get redirected to a /busy.html file. This can help keep your site alive under heavy load.
  • Simple to configure with your web server. Even if you use clustering you’ll be able to manage your webserver and Rails application independently.
  • Reasonable defaults for almost everything based on user feedback.
  • Completely free code licensed under Rails’s own license.

Downloads

You can grab the latest version from my downloads directory in various formats. Version numbers are always increasing so hopefully you can figure out which one is the latest. For example, 0.4.3 is more recent than 0.4.2.

Dependencies

You need to have cmdparse 2.0.0 or greater and highline 1.0.1 or greater. If you install by gem then this should be done for you.

Install

The quick guide to installing SRR is to simply download the gem and install it directly:

wget http://www.zedshaw.com/downloads/scgi_rails/scgi_rails-0.4.3.gem gem install scgi_rails-0.4.3.gem

That should do it for just about everyone. If you’re allergic to RubyGems or have the need to install directly, then you can do the following:

wget http://www.zedshaw.com/downloads/scgi_rails/scgi_rails-0.4.3.tar.bz2 tar -xjf scgi_rails-0.4.3.tar.bz2 cd scgi_rails-0.4.3 sudo ruby setup.rb

If you don’t know what any of those commands do then just install the gem or learn to use Unix.

Documentation

There’s a fair bit of documentation in the works, with more to come. Feel free to suggest other information if you can think of any.

  • README and RDoc
  • FAQ—Frequently Asked Questions with solutions.
  • HOWTO—Helps you get started and do some advanced stuff with SRR.
  • Lighttpd Configuration—Configuration for lighttpd 1.4.4 (works with others, but YMMV).
  • Apache2 Configuration—Configuration for Apache2 (not win32 though).
  • Apache1 or Apache2—Win32 install with pre-compiled mod_scgi.so for both servers.
  • Performance Analysis—Compares SRR with other methods to validate performance requirements. Lost of statistics here so you probably will not be interested.

Suggesting Improvements

The best way to suggest improvements is to contact me via e-mail. Since I really detest spam and crazy idiots I seem to find on the Internet, I’m leaving it to you to figure out my e-mail address. I’ll give you a hint though: My name is Zed Shaw. I have a website named zedshaw.com.

I also like receiving bug reports that have lots of information in them. I’ll usually help anyone who asks, but you can probably get faster response if you hop onto irc.freenode.org and go into the #ruby-lang channel looking for zedas (that’s me).