Summary
A recent Sun Developer Network article discusses how to run Ruby on Rails applications on Sun's Java Web Server using FastCGI. The approach outlined uses the platform's Ruby interpreter, instead of relying on JRuby.
Advertisement
The traditional manner of deploying a Rails application on a Web server with good performance has been to rely on FastCGI. An extension of the traditional common gateway interface (CGI), FastCGI was developed by OpenMarket to provide a scalable way for a Web server to interface an external process, such as the host's Perl or Ruby interpreters.
In essence, FastCGI creates a pool of processes of the external application, keeps those processes running, and hands requests to that pool for processing. That eliminates the overhead of starting a new process to serve each request, traditional CGI's major performance bottleneck. While FastCGI is quickly being supplanted by Mongrel as a preferred Rails deployment configuration, FastCGI is still a tried and trusted Rails deployment option.
One of FastCGI's benefits is that it works with many Web servers, including Sun's freely available Java Web Server. A recent Sun Developer Network article by Seema Alevoor and Marina Sum, Running Ruby on Rails on Sun Java System Web Server 7.0, provides a tutorial introduction to setting up a Rails application on Sun's server software.
One advantage of using the Sun Web Server is that it provides sophisticated support for Java applications as well, making it possible to co-mingle Java and Rails within one Web application. According to CVR Chintalapati, Sun's Java Web Server engineering manager:
Support for scripting [languages, such as Ruby] is a key product strategy at Sun... With its scalability, manageability, and fully integrated Java EE servlet container and FastCGI for integrating native scripting technologies ... Sun's Java System Web Server 7.0 offers a robust deployment platform for Rails, PHP, and Java EE platform-based ... applications.
Only a few simple configuration steps are necessary for enabling Ruby on Rails ... to run on Sun Java System Web Server 7.0.
The Sun Developer Network article is a step-by-step configuration guide of connecting FastCGI to the Sun server software, and then having FastCGI invoke Ruby to handle requests for the Rails application. The article does not provide benchmarks or performance measurements.
To follow in the trails of a recent Artima discussion, what do you think of "hybridizing" the server-side of a Java Web application by introducing, for example, Rails to handle parts of the application?