FPM: Difference between revisions
From DWIKI
mNo edit summary |
m (→FAQ) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
*[https://www.php.net/manual/en/install.fpm.php Documentation] | *[https://www.php.net/manual/en/install.fpm.php Documentation] | ||
*[https://www.digitalocean.com/community/tutorials/how-to-configure-apache-http-with-mpm-event-and-php-fpm-on-ubuntu-18-04 Switching to FPM on Ubuntu/Debian] | *[https://www.digitalocean.com/community/tutorials/how-to-configure-apache-http-with-mpm-event-and-php-fpm-on-ubuntu-18-04 Switching to FPM on Ubuntu/Debian] | ||
=Monitoring PHP-FPM= | |||
*https://www.php.net/manual/en/fpm.status.php | |||
*[https://www.zabbix.com/integrations/phpfpm Zabbix monitoring php-fpm] | |||
*[https://github.com/jizhang/zabbix-templates/tree/master/php-fpm zabbix php fpm] | |||
==fpm configuration== | |||
pm.status_listen = 127.0.0.1:9001 | |||
pm.status = /fpm-status | |||
pm.ping = /fpm-ping | |||
==Apache== | |||
# I suppose you don't really have to use separate port for this, but might avoid problems | |||
Listen 127.0.0.1:89 | |||
<Virtualhost 127.0.0.1:89> | |||
<Location /fpm-status> | |||
Require host localhost | |||
ProxyPass unix:/run/php/php-fpm.sock|fcgi://localhost:9001 | |||
</Location> | |||
<Location /fpm-ping> | |||
Require host localhost | |||
ProxyPass unix:/run/php/php-fpm.sock|fcgi://localhost:9001 | |||
</Location> | |||
</VirtualHost> | |||
=HOWTO= | |||
==Configuring number of servers== | |||
dynamic - the number of child processes are set dynamically based on the | |||
following directives: | |||
pm.max_children - the maximum number of children that can | |||
be alive at the same time. | |||
pm.start_servers - the number of children created on startup. | |||
this value must not be less than min_spare_servers | |||
and not greater than max_spare_servers. | |||
pm.min_spare_servers - the minimum number of children in 'idle' | |||
state (waiting to process). If the number | |||
of 'idle' processes is less than this | |||
number then some children will be created. | |||
pm.max_spare_servers - the maximum number of children in 'idle' | |||
state (waiting to process). If the number | |||
of 'idle' processes is greater than this | |||
number then some children will be killed. | |||
=FAQ= | |||
==proxy_fcgi AH01071: Got error 'Primary script unknown'== | |||
The fcgi 404, so you're requesting a nonexisting link | |||
==AH01079: failed to make connection to backend: httpd-UDS== | |||
USB = Unix Domain Socket, look for logging/config about the socket involved | |||
==WARNING: [pool www] ACL set, listen.owner = 'apache' is ignored== | |||
Redhat feature, check commenting out acl_users in www.conf | |||
==Show php-fpm config== | |||
php-fpm8.0 -tt |
Latest revision as of 11:25, 26 April 2023
FastCGI Process Manager
Links
Monitoring PHP-FPM
fpm configuration
pm.status_listen = 127.0.0.1:9001 pm.status = /fpm-status pm.ping = /fpm-ping
Apache
- I suppose you don't really have to use separate port for this, but might avoid problems
Listen 127.0.0.1:89 <Virtualhost 127.0.0.1:89> <Location /fpm-status> Require host localhost ProxyPass unix:/run/php/php-fpm.sock|fcgi://localhost:9001 </Location> <Location /fpm-ping> Require host localhost ProxyPass unix:/run/php/php-fpm.sock|fcgi://localhost:9001 </Location> </VirtualHost>
HOWTO
Configuring number of servers
dynamic - the number of child processes are set dynamically based on the following directives: pm.max_children - the maximum number of children that can be alive at the same time.
pm.start_servers - the number of children created on startup. this value must not be less than min_spare_servers and not greater than max_spare_servers.
pm.min_spare_servers - the minimum number of children in 'idle' state (waiting to process). If the number of 'idle' processes is less than this number then some children will be created.
pm.max_spare_servers - the maximum number of children in 'idle' state (waiting to process). If the number of 'idle' processes is greater than this number then some children will be killed.
FAQ
proxy_fcgi AH01071: Got error 'Primary script unknown'
The fcgi 404, so you're requesting a nonexisting link
AH01079: failed to make connection to backend: httpd-UDS
USB = Unix Domain Socket, look for logging/config about the socket involved
WARNING: [pool www] ACL set, listen.owner = 'apache' is ignored
Redhat feature, check commenting out acl_users in www.conf
Show php-fpm config
php-fpm8.0 -tt