If you have been using Ruby on Rails or at least investigating it you should have come across FastCGI at one time or another. Many Ruby developers that I have talked to swear by this method of serving Ruby since it seems to be extremely fast and less resource-dependent. CodeHaus has a good writeup describing the differences between Java’s method of threading in contrast to FastCGI’s method of processes. This tidbit is what interests me:

In contrast, a FastCGI implementation will on startup pre-fork off a number of CGI processes. Each process will listen to standard input (or any other IPC solution such as named pipes, domain sockets or even network sockets in case of a cluster). As a request comes in an available process is chosen and the content of the request is sent as name-value pairs to the process. The FastCGI implementation captures the output and sends it back to the client. The process is then returned back to the pool of available processes.

Of course that made me wonder what would happen in a server farm environment and I saw that this problem was raised in the comments.

…if you for example create one hundred FastCGI processes per server in a 20 blade cluster then each separate process needs to allocate one database connection. This would amount to 2000 database connections which occupies a lot of memory (both in the database server and on the client) and bluntly put just doesn’t scale.

It’s also interesting to note how many Java programmers are always in the defensive about their language. I figured by now that all developers would understand that programming languages are just tools to use so defending one over the other as if it is a life or death situation makes no sense to me. Most likely they are looking out for their jobs.

Share and Enjoy

  • StumbleUpon
  • Reddit
  • Digg
  • del.icio.us
  • Facebook
  • TwitThis

Related posts:

A DIY Guide to Installing Ruby, Rails, and FastCGI
University of Illinois Launches 640 Xserve Turing Cluster
Open Supercomputing Turns 10
Google Desktop Proxy
PHP 5 Installer for OS X

Hope you like that post!

Forever Geek is a resource for all things geek. You can stay tuned by having the latest FG news delivered to you for free via RSS.