[TYPO3-dev] mod_fcgid

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Oct 27 21:02:30 CET 2008


Dan Osipov wrote: on 22.10.2008 22:28:
> Just read the following article:
> http://typo3.org/development/articles/using-php-with-mod-fcgid/page/1/
> 
> The first page claims enormous speed gains over mod_fastcgi. The last
> page says the speed is slower than for mod_php. I'm confised - what's
> the fastest, most efficient way to set up PHP processing in Apache?

Fast-CGI is a protocol for intermediating between apache's processes
that call CGI scripts and a "long running" fast-CGI application, which
doesn't need to be exit'ed and restarted on every hit. This works with
PHP CGI binary that is compiled with the "fastCGI" option (meaning it
supports the fast-cgi protocol) (which is the case of php5-cgi provided
with debian, btw).

Now there is:

a) mod_fastcgi = original fast CGI module for apache, development seems
to stand still [1]

b) mod_fcgid = chinese response to the "almost dead" project
mod_fastcgi. It is an complete compatible alternative to mod_fastcgi,
with much more "tuning" options and allegedly better process management
strategy [2]

c) mod_fcgi = never heard of that...

d) mod_php = the "good old" PHP module for apache

Running PHP as a module is always the fastest (for "single hits"), but
it has some drawbacks: Doesn't scale well (all apache process are loaded
with the "huge php-monster module", even if the request just needs to
fetch a static file, image, etc), and it runs in the Apache user-context
("www-data" or "www-run" or whatever), meaning multiple Vhosts all share
the same common "user-space" and php.ini, meaning lack of security
(critical for shared web-spaces, non-critical for single
one-customer-only machines).

This is where fast-CGI comes in, in one of the above mentioned flavours
(a or b). To increase security and flexibility in multi-hosted
environment, as every Vhost can have a different php.ini, user running
PHP, etc. And it still is amazingly fast, as the PHP processes will be
long running in paralell to the Apache processes that are making use of
them.

Some disttributions provide mod_fastcgi and mod_fcgid (e.g. debian
etch), so you just need to choose which one you need (and most tutorials
on the net will choose mod_fcgid).

Cheers,
Ernesto

[1] http://www.fastcgi.com/
[2] http://fastcgi.coremail.cn/




More information about the TYPO3-dev mailing list