3 ms·
As a good number of folks have pointed out, this article (helpful for sure) is basically nginx + PHP-FPM. nginx servers up static content (e.g. if you are usin
by rkalla 15y ago
As a good number of folks have pointed out, this article (helpful for sure) is basically nginx + PHP-FPM.
nginx servers up static content (e.g. if you are using WP-SuperCache and it's generating those static cache files for you, JS, CSS, images, etc.) then you configure a pool of warmed up PHP VM instances via PHP-FPM (Check /etc/php5/php-fpm or some equiv dir on your server).
Then you setup a rule that directed PHP requests to the FPM service, that would probably look something like this in nginx:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/mysite.com/$fastcgi_script_name;
include fastcgi_params;
}
and instead of adding the layer of Apache servicing the PHP requests, you are having nginx pass through the PHP requests directly to PHP processes to run.
Going from an Apache2 + FCGID configuration (somewhat similar to this, but with Apache) to nginx, I saw a 75% drop in server load.
I'm almost certain this still isn't a totally tweaked out setup that someone more familiar with this process could do better, but for my needs it took my server crashing under load no matter what I did, to typically being idle most of its life (~900k/month pageviews)
So I'm a big fan of nginx. I'm not saying you couldn't configure Apache to do the same... just 5 years of attempts to do so never got me anywhere with it.