Forum > Networking and Web Programming

FCGI (FastCGI) step by step, using fpweb/fcl-web for Windows/Linux

<< < (2/11) > >>

jixian.yang:
FastCGI can not be found in SVN18020 of Freepascal.

Silvio Clécio:
The long thread about FCGI:

http://www.mail-archive.com/lazarus@lists.lazarus.freepascal.org/msg20061.html

kodok_buncit:
hi bobo and all..
is this fcgi app multhithread?

bobo:
kodok_buncit:
The CGI modules are handling one request at a time - there is no need for multi-thread theoretically - because the web server starts up a new instance of the module for each request. If there are multiple simultaneous requests are arriving, then there will be multiple instances of the CGI application running at the same time.

For FCGI modules, since they are sitting in the memory, it would be possible to do multi-threading, but the standard is to have a queue for multiple request handling and the protocol has an identifier for every request so the server does not mixes up the responses from the same FCGI application instance.
A "pseudo" multi-threading is done kind of the same way as with CGI modules (where every request spawns a new copy of the CGI application) because the web server (Apache in these examples) can spawn multiple instances of the FCGI module to sit in the memory and to wait for incoming requests.
There are many many configuration settings for the web server on how to do the FCGI request/response handling, the best if you read up on them in the documentation.
For example, how many instances of the FCGI application to spawn, after how many requests to restart an FCGI instance, after how much idle time to restart an FCGI instance, etc. (these vary between the mod_fcgid and mod_fastcgi, each has their own settings)

kodok_buncit:
thanks bobo, i'm curious about how implemented connection pooling(database) on fcgi environment and share object instance accross all client/request so the app can be more efficient.
I will read more about fastcgi

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version