|
2 | 2 |
|
3 | 3 | Installs and configures the PHP-FPM flavour of FastCGI. |
4 | 4 |
|
| 5 | +Note, for legacy reasons this role sets up PHP-FPM to use TCP/IP instead of a Unix socket by default. However, we *recommend* you change this by setting `unix_socket: true` unless you really need to run PHP-FPM over TCP/IP, as a Unix socket is much faster. If you do, be sure to set the `pool_group` variable to match your web server user, or the web server will be unable to interact with PHP. |
| 6 | + |
5 | 7 | <!--TOC--> |
6 | 8 | <!--ENDTOC--> |
7 | 9 |
|
|
13 | 15 | # see php-common for default version |
14 | 16 | fpm: |
15 | 17 | # FPM settings - official documentation is here: https://www.php.net/manual/en/install.fpm.configuration.php |
16 | | - unix_socket: false # set to true to use a unix socket, you must also update nginx and cachetool if you do |
| 18 | + unix_socket: false # set to true to use a unix socket, you must also update nginx and cachetool if you do |
17 | 19 | server_ip: "127.0.0.1" |
18 | | - tcp_port: "" # leave empty to automate port selection - port will be "90{{ version | replace('.','') }}" - e.g. 9081 for PHP 8.1 |
19 | | - pool_user: "{{ user_deploy.username }}" |
20 | | - pool_group: "{{ user_deploy.username }}" # if using unix socket this should be the web server user |
| 20 | + tcp_port: "" # leave empty to automate port selection - port will be "90{{ version | replace('.','') }}" - e.g. 9081 for PHP 8.1 |
| 21 | + pool_user: "{{ user_deploy.username }}" # this should always be the deploy user, usually deploy |
| 22 | + pool_group: "{{ user_deploy.username }}" # if using unix socket this should be the web server user, often www-data |
21 | 23 | pm: dynamic # can also be static, see https://tideways.com/profiler/blog/an-introduction-to-php-fpm-tuning |
22 | 24 | default_socket_timeout: 60 |
23 | 25 | # It is important to scale up processes on bigger servers, so that more |
24 | 26 | # requests can be handled. Double the number of vCPUs is a good default. |
25 | 27 | # Can be between 5 and 64. |
26 | | - max_children: "{{ [5, [(ansible_facts.ansible_processor_nproc | default(1)) * 2, 64] | min] | max }}" # Fallback in case ansible_processor_nproc is not gathered before tasks |
| 28 | + max_children: "{{ [10, [(ansible_facts.ansible_processor_nproc | default(1)) * 2, 64] | min] | max }}" # Fallback in case ansible_processor_nproc is not gathered before tasks |
27 | 29 | start_servers: 2 |
28 | 30 | min_spare_servers: 1 |
29 | 31 | max_spare_servers: 3 |
|
0 commit comments