Just wanted to share my experience trying to speed up the system by switching to using the fastCGI process manager on Apache 2.4 - specifically using mod_proxy_fcgi.
It wasn’t too difficult to get everything working. The main thing was to make sure the required php settings ended up in the right config file.
The speed increase was quite significant, however I’m still trying to get daily crons to run correctly. I think there’s a timeout somewhere that I must be missing - most likely proxy related. Once I figure out what’s going on, it shouldn’t be too hard to resolve.
In any case, if anyone is planning on going down this road, I think it can be worthwhile. In my (un-scientific) testing, I’m seeing about a 50% speed increase in page loads.
1/ installed fpm module with apt (php7.0-fpm)
2/ configured this /etc/php/7.0/fpm/pool.d/www.conf , by adding “listen = 127.0.0.1:9000” (before was a socket)
3/ included this on the virtual host: ProxyPassMatch ^/(..php(/.)?)$ fcgi://127.0.0.1:9000/var/www/acunetix.eramba.org/eramba_v2/$1
4/ loaded the following php modules: proxy_fcgi
5/ restarted apache and voila
With fastCGI mpm_prefork isn’t ideal. You really want to use mpm_event or mpm_worker, but it’s a little tricker to set up. Also, depending on your server memory, there’s a lot of tuning you can do for php-fpm (www.conf) and apache (mpm_event.conf or mpm_worker.conf)
Here were my steps…
Disabled mpm_prefork, mod_php7.0
Enabled mpm_event, proxy_fcgi
I didn’t use ProxyPassMatch - it causes some issues with .htaccess. I did this instead…
@jsalehy i was looking today at fpm server to offload some specific URIs to an alternative server other than the main server. the idea is the browser hits a normal apache+fpm+mysql server but apache has an additional proxy setting that forwards /securityServices URI to another server running fpm
I’m not entirely sure what im doing wrong … seems like fpm does not understand the .htaccess on eramba (rewrites, etc) ? … the weird thing is i dont get an error on the browser, i get eramba served by the apache built in php module.
So i thought FPM was working but from the debug above you can see standard php is serving content…i think you mention on your post something about this but i’m not sure what the solution is. maybe you can enlighten?
In regards to the other attempt (redirect a single uri) i get a “File not found” error on the browser, the fpm logs on that server shows:
Ok - i had an issue on my regex matching php files so now it works , just in case i disabled mod_php on apache and pages load. i still find it weird that the fpm access log shows only index.php no matter what i throw at eramba…no idea why really.
I’ll now keep working on the URI redirect , we want to off load crons to an alternative server. let us know if you tried something like that with success!