Configure PHP-FPM processes
NOTE: We are in the process of modifying the file structure and configuration for many Bitnami stacks. On account of these changes, the file paths stated in this guide may change depending on whether your Bitnami stack uses native Linux system packages (Approach A), or if it is a self-contained installation (Approach B). To identify your Bitnami installation type and what approach to follow, run the command below:
$ test ! -f "/opt/bitnami/common/bin/openssl" && echo "Approach A: Using system packages." || echo "Approach B: Self-contained installation."
The output of the command indicates which approach (A or B) is used by the installation, and will allow you to identify the paths, configuration and commands to use in this guide. Refer to the FAQ for more information on these changes.
It is possible to configure PHP-FPM processes per application. If you have a lot of applications, this may result in excessive CPU usage.
You can configure your application’s PHP-FPM processes to start automatically when needed. Add this option to the PHP-FPM pool configuration file:
NOTE: Depending on your installation type, you can find the PHP-FPM pool configuration file for your application in the following locations:
- Approach A (Bitnami installations using system packages): /opt/bitnami/php/etc/php-fpm.d/www.conf
- Approach B (Self-contained Bitnami installations): /opt/bitnami/apps/apps/APPNAME/conf/pfp-fpm/pool.conf
You can also reduce the number of PHP-FPM processes per application by modifying the files below.
If you configured the processes to start dynamically, modify the /opt/bitnami/php/etc/common-dynamic.conf as below:
pm=dynamic pm.max_children=5 pm.start_servers=2 pm.min_spare_servers=1 pm.max_spare_servers=3
If you configured the processes to start on demand, modify the /opt/bitnami/php/etc/common-ondemand.conf as below:
pm=ondemand pm.max_children=5 pm.start_servers=2 pm.min_spare_servers=1 pm.max_spare_servers=3