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.
PHP: What are the advantages of FastCGI over mod_php
apache-2.2fastcgimod-phpperformancePHP
Related Topic
- Mysql – Viability of Apache (MPM Worker), FastCGI PHP 4/5.2/5.3, and MySQL 5
- Php – How to run PHP files as another user with Apache and FastCGI
- Linux – A single php-fastcgi process blocks all other PHP requests
- Php – difference of PHP handler (CGI vs FastCGI vs Mod_PHP vs suPHP )
- Php – fastcgi php and memory limit
- Is PHP Option ‘cgi.fix_pathinfo’ Dangerous with Nginx + PHP-FPM?
Best Answer
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
worker_mpm
allows you to serve many requests with a single threaded Apache worker. However, even in 2009, this is not the recommended way to deploy PHP because of suspected threading issues with the PHP extensions.)By using PHP in fast_cgi mode (using something like spawn-fcgi from the lighttpd package) has the following benefits