Skip to content

fix(php-fpm): Set a good process children default for bigger servers #1895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/roles/debian/php-fpm.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ php:
pool_group: "{{ user_deploy.username }}" # if using unix socket this should be the web server user
pm: dynamic # can also be static, see https://tideways.com/profiler/blog/an-introduction-to-php-fpm-tuning
default_socket_timeout: 60
max_children: 5
# It is important to scale up processes on bigger servers, so that more
# requests can be handled. Double the number of vCPUs is a good default.
# Can be between 5 and 64.
max_children: "{{ [5, [ansible_facts.processor_vcpus * 2, 64] | min] | max }}"
start_servers: 2
min_spare_servers: 1
max_spare_servers: 3
Expand Down
5 changes: 4 additions & 1 deletion roles/debian/php-fpm/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ php:
pool_group: "{{ user_deploy.username }}" # if using unix socket this should be the web server user
pm: dynamic # can also be static, see https://tideways.com/profiler/blog/an-introduction-to-php-fpm-tuning
default_socket_timeout: 60
max_children: 5
# It is important to scale up processes on bigger servers, so that more
# requests can be handled. Double the number of vCPUs is a good default.
# Can be between 5 and 64.
max_children: "{{ [5, [ansible_facts.processor_vcpus * 2, 64] | min] | max }}"
start_servers: 2
min_spare_servers: 1
max_spare_servers: 3
Expand Down
Loading