This is more to understand the request-response mechanism in web apps. A client sends a request (GET / POST) to a web app. The web app has an application server running which serves as the container for the application specific programs. I don't understand the part when the app server starts a FastCGI / CGI process. What is the significance of CGI? Aren't the servers designed to handle the complete request handling mechanism? What part of the request handling relies on CGI?
I asked a similar (although it's more close to implementation then concepts) question here: HTTP request dispatch from Web Server to a CGI/FastCGI process
However, here's what I've been able to learn on the way: CGI is a set of "standards" that define how an HTTP/Web Server should communicate with external programs. Note the word standards! Although not an out and out protocol (like HTTP, TCP etc) but it is pretty close being one as the set of standards are complied to by most of the external programs that generate HTML (Ruby, PHP, Python etc).
You can read more about CGI here: http://hoohoo.ncsa.illinois.edu/cgi/intro.html
and here: http://www.w3.org/CGI/
FastCGI is an improvement on the way CGI processes are handled - put in a super simple way a FastCGI process stays loaded in the memory for a longer time so that it can process multiple requests while it's loaded in the memory. Obviously that works more efficiently since the time & resources lost in loading the basic CGI environment never does happen that frequently in FastCGI processes
A little off the track and Rails specific, but this is an interesting artice: http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With