ClickAider
You are currently browsing the Bogle’s Blog weblog archives for the day Monday, June 12th, 2006.

Easy FastCGI for Ruby on Rails

Using FastCGI with Rails is more complex than it ought to be, but a simple script can make it nearly trivial.

The Lighttpd launcher script is a drop-in alternative to script/server which uses Lighttpd and FastCGI rather than web-brick. Just launch it and go, or pass the --daemon switch to run as a daemon. Lighttpd is generally recognized as one of the highest performing web servers to use wtih Rails. (I ran yum install lighttpd and yum install lighttpd-fastcgi to install the necessary prerequisites on Fedora.)

My only nit is that there should be an option to update the global lighttpd config in etc and restart the main lighttpd service rather than creating a private server; I’m currently working on changes to add this functionality and will share it when ready.

What about running FastCGI with Rails on Apache 2? This appears to be a bad idea in general. James Duncan Davidson reports on consistent problems under load with zombie Rails processes. The post links to a number of different posts from around the web that confirm and diagnose the problem, and suggests alternative configurations including Lighttpd rather than using FastCGI in Apache directly.

My own experience seems to confirm this; my system became unusable under the weight of zombie processes (with a load of greater than 30 and incredible amounts of swapping.) I’ve switched instead to a configuration in which Apache acts a reverse proxy to a Lighttpd/FastCGI/Rails server.

Browse and Share Berry411 Mobile Search Plugins

The Berry411 Plugins page is a new feature of the Berry411 service. It provides a categorized directory of all Berry411 search plugins, including previews of the results from each plugin. You can also add new plugins and share them with the Berry411 community.

Some of the best ideas for plugins, like the recently flight tracking plugin, come from users, so this is an easy do-it-yourself way for any user to add a plugin. (A plugin can point to the results of search form, or simply be a convenient name for a page to save users to trouble of typing a long URL.)

Personalization features like Berry Plugins will now be much easier for me to implement, now that I have rewritten the core of the Berry411 backend in Ruby on Rails. It’s possible there will be a few bumps in the road with this significant transition, so please share with me any problems you might encounter as well as suggestions for improvement.

And please do create some plugins!