Fleegix on FastCGI

2005-09-14 01:08:00

I was seeing a lot of sporadic errors running Typo with mod_ruby -- typical of the problems I have seen trying to run multiple, disparate Ruby Web-apps under a single Apache instance with mod_ruby. This is apparently due to the way that the Ruby interpreter embedded in the apache child process persists data between requests.

I had managed to find ways to code around the problem with all my homegrown Web-apps, but Typo doesn't seem to be quite that accommodating. Most of the Rails docs seem to assume using FastCGI instead of mod_ruby, and now I see why.

Shugo Maeda, the creator of mod_ruby, has an entry on his Weblog that talks about how to use Typo under mod_ruby, but what are trivial fixes to a genius like Maeda-san, don't look so trivial to a techie peon like myself.

In any case, with all the sporadic 500 errors -- I punted, and for the last couple of days I've been running Typo as an old-school CGI. And man, that was seriously sluggish -- like me without my morning coffee: horribly, excruciatingly slow.

So tonight, after wrestling with the config a bit, I managed to get FastCGI set up with surprisingly little pain. I even found a really nice post on Scott Laird's Weblog on Apache tuning for Rails and FastCGI, that shows how to switch FastCGI to static mode to improve performance.

FastCGI does indeed seem to be pretty damned fast,and if it proves to be stable, I'll likely look into moving some of my other Ruby Web-app code over. It'll be nice to enjoy the benefits of decent performance and not have to worry so much about shared Ruby processes in the server, stepping all over each other.


This is the blog for Matthew Eernisse. I currently work at Yammer as a developer, working mostly with JavaScript. All opinions expressed here are my own, not my employer's.


Previous posts

All previous posts ยป

This blog is a GeddyJS application.