It was recently suggested to me that I use FastCGI with PHP. Now I went to the FastCGI page and read it but I don't really understand what the advantages are.
|
Using mod_php each Apache worker has the entire PHP interpreter loaded into it. Because Apache needs one worker process per incoming request, you can quickly end up with hundreds of Apache workers in use, each with their own PHP interpreter loaded, consuming huge amounts of memory. (Note, this isn't exactly true, Apache's By using PHP in fast_cgi mode (using something like spawn-fcgi from the lighttpd package) has the following benefits
|
||||
|
|
|
FastCGI means that the php bits aren't running in the same process as the apache bits, unlike with mod_php. This separation can have some definite advantages when it comes to restarting the server or dealing with runaway applications - in the mod_php case that means that it's the apache process that's "runaway", but under fastcgi it's just a process that apache is talking to, so the entire server doesn't have to be taken down. |
|||
|
|
|
Another advantage not yet mentioned is the fact that with With mod_php, all vhosts share the same user, which is Apache's user. This can lead to security issues. |
|||
|