FAQ

What is FastCGI ?
FastCGI is the evolution of CGI. A CGI application runs on a web server and processes an HTTP requests (from a Web Browser for example). It receives a request, processes it and returns something for the Web Browser to display. The CGI application is launched by the web server (like IIS) when the request comes in, and it closes immediately after it has returned the reply. A
CGI application can only process one request at a time. A FastCGI application does not need to close after a request, and can process many requests, one after the other.
The benefit of this is that databases do not need to be opened and closed for each request and other variables (like a counter for example) may persist over many requests. This makes a FastCGI application faster and more efficient


What is the FCGI Dll Library ?
The FastCGI Dll library is a bridge between the Web Server and your code. It contains all the FCGI functionality necessary to receive an HTTP request and return a respose. It manages the FCGI communication protocol providing access to the request varaibles and data via a few simple functions.


What is a SIGTERM handler ?
If no requests have been received for a Timeout seconds, then the Web Server will shut down the FastCGI application. Since databases may be open, a signal that this about to happen (SIGTERM) allows the application to close the databases and clean up and terminate before the Web Server abruptly kills the application.

I use php, do I need this?
No. This library is an API that is designed for developers that want to utilize the power of a language like C and take advantage of pre-existing code (like Compression, Encryption and database  wrappers) for server side applications.

How is FastCGI different from CGI?

 FastCGI is conceptually very similar to CGI, with two major differences:

    * FastCGI processes are persistent: after finishing a request, they wait for a new request instead of exiting.

    * Instead of using operating system environment variables and pipes, the FastCGI protocol multiplexes the environment information, standard input, output and error over a single full-duplex connection. This allows FastCGI programs to run on remote machines, using TCP connections between the Web server and the FastCGI application.

 

 Request processing in a single-threaded FastCGI application proceeds as follows:

   1. The Web server creates FastCGI application processes to handle requests. The processes may be created at startup, or created on demand.

   2. The FastCGI program initializes itself, and waits for a new connection from the Web server.

   3. When a client request comes in, the Web server opens a connection to the FastCGI process.

       The server sends the CGI environment variable information and standard input over the connection.

   4. The FastCGI process sends the standard output and error information back to the server over the same connection.

   5. When the FastCGI process closes the connection, the request is complete.

        The FastCGI process then waits for another connection from the Web server.






Comments