View Single Post

  #4 (permalink)  
Old 02-27-2008
Michael Fesser
 
Posts: n/a
Default Re: Is fast-cgi a drop-in replacement for mod_php?

..oO(Evil Son)

>I must admit though that this behaviour is surprising since part of
>the reason for fastcgi (as I understood it anyway) was to maintain
>state/resources across requests - e.g. an open database connection.


Not exactly. The main problem with "normal" CGI is that on every single
request the script interpreter or external program has to be invoked
over and over again, because after handling the request the program will
be terminated. This not only slows down the execution, it also wastes
memory if multiple instances of the interpreter are loaded at the same
time.

FastCGI helps to overcome these performance issues by loading the
interpreter only once if possible and keeping it in memory. But this
only affects the interpreter itself, it doesn't magically turn PHP into
a real application server.

>It seems that PHP in fastcgi mode doesn't ... and I'm quite happy with
>that as it avoids a whole class of bugs.


There are some minor differences between the server module and a
(Fast)CGI version (some features/functions are only available in the
module), but most things work exactly the same.

Micha
Reply With Quote