From: Brian Candler Date: 2012-05-24T01:12:52+09:00 Subject: Re: Ruby through CGI and Rails Andrew Mcelroy wrote in post #1061808: > On Wed, May 23, 2012 at 4:36 AM, Brian Candler > wrote: > >> > performance issues. >> >> That just means you're using it wrong. Rails was *never* intended to be >> run as a CGI, it's just a ridiculuous thing to do. Run Rails as a >> persistent webserver and proxy to it; or run it under Apache using >> Phusion Passenger, which will also run any other Rack-based application. >> > > At the end of the day, look at what rack is using. CGI. Rack is an API. The request variables it passes on happen to be similar to CGI environment variables. Rack invokes your handler's "call" method for each request. A single process can handle many requests (even concurrent requests in different threads, if the web server supports this) CGI is also an API. However in practice CGI requires a new process to be started for each request, the parameters to be passed in that process' environment, the request to be passed on stdin (until EOF) and the response to be returned on stdout (until EOF). It cannot accept more than one request per process. That is, although the CGI spec allows for "system defined" ways of passing the environment, the only implementation you are likely to find is as described above. Of course there are things like FastCGI and SCGI which support persistent processes, but I would consider those not to be CGI. -- Posted via http://www.ruby-forum.com/.