19.2. Using FastCGI

The most often criticized shortcoming of CGI is that it requires a new process to be created for every invocation. The effect on performance is significant. The lack of the capability to leave objects in memory between requests can also have a negative impact on design. The combination of these difficulties has led to the creation of FastCGI.

FastCGI is basically nothing more than a protocol definition and software implementing that protocol. Usually implemented as a web server plugin, such as an Apache module, FastCGI allows an in-process helper to intercept HTTP requests and route them via socket to a long running backend process. This has a positive effect on speed compared to the traditional forking approach. It also gives ...

Get The Ruby Way: Solutions and Techniques in Ruby Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.