Been wondering how this should be done.
On previous versions of apache (in debian 9) this is how I was doing it.
This way I could limit size of php pool and if pool reached it's max, apache would queue up requests and unless we reached acquire
delay (here 10s) in the queue, no errors would spit out
<IfModule proxy_fcgi_module>
# on previous versions of apache, having enablereuse on socks would hang
# when php reached it's max number of requests (set in fpm pool)
<Proxy "unix:/run/php/pool.php7.3-fpm.sock|fcgi://pool-php-7-3" enablereuse=Off max=5 >
ProxySet connectiontimeout=3 timeout=30 acquire=10
</Proxy>
</IfModule>
<VirtualHost *>
ServerName example.com
DocumentRoot /path/to/docroot
<Directory /path/to/docroot>
Options +Indexes
AllowOverride all
Require all granted
</Directory>
<IfModule proxy_fcgi_module>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler "proxy:fcgi://pool-php-7-3"
</FilesMatch>
</IfModule>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# CustomLog /dev/null
# ErrorLog /dev/null
</VirtualHost>
Now on more recent versions of apache it seems that we want to have enablereuse=On
or have really poor performance.
I'm trying to get this to work nicely on a VPS.
thanks for advices on how this should be defined in recent versions of apache2.4 It's nicer to have users wait a couple seconds more when php pool reached it's maximum than to throw them an error. I use to have this working nicely before :)
Perhaps I'm not phrasing this the write way for apache ?