I've been setting up a server using Apache 2.4, mpm_event, mod_proxy_fcgi and php_fpm.
In the mod_proxy_fcgi docs (https://httpd.apache.org/docs/2.4/mod/mod_proxy_fcgi.html) it mentions "For performance reasons, you will want to define a worker representing the same fcgi:// backend."
Their example:
<FilesMatch "\.php$">
# Note: The only part that varies is /path/to/app.sock
SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/"
</FilesMatch>
# Define a matching worker.
# The part that is matched to the SetHandler is the part that
# follows the pipe. If you need to distinguish, "localhost; can
# be anything unique.
<Proxy "fcgi://localhost/" enablereuse=on max=10>
</Proxy>
Now my question is; I have a php_fpm pool setup for each Vhost and specify the 'SetHandler' for each vhost so it uses the proper pool, should I be setting up a new proxy worker per vhost as well?
Example Vhost 1:
<FilesMatch "\.php$">
SetHandler "proxy:unix:/path/to/app1.sock|fcgi://app1/"
</FilesMatch>
<Proxy "fcgi://app1/" enablereuse=on max=10></Proxy>
Example Vhost 2:
<FilesMatch "\.php$">
SetHandler "proxy:unix:/path/to/app2.sock|fcgi://app2/"
</FilesMatch>
<Proxy "fcgi://app2/" enablereuse=on max=10></Proxy>
Or is using 'fcgi://localhost/' in each SetHandler the proper way?