Switch PHP's default process manager

Changing from dynamic to ondemand lowers the number of idle PHP processes from the default of 3 to 1. PHP automatically scales up the number of processes when required, but kills them after 10 seconds (default). I've seen PHP's memory consumption drop significantly. This should be very helpful for low-end VPS servers. Tested for a couple of months on a VPS with 1 GB and 1 CPU with 5 users. No noticeable negative loading times, but about 15% less RAM usage.

Based on this article: https://ma.ttias.be/a-better-way-to-run-php-fpm/
This commit is contained in:
dofl 2017-07-26 07:51:29 +02:00 committed by GitHub
parent 6ace97e482
commit 6ec76b4842
1 changed files with 5 additions and 1 deletions

View File

@ -51,6 +51,10 @@ tools/editconf.py /etc/php/7.0/fpm/php.ini -c ';' \
tools/editconf.py /etc/php/7.0/fpm/php.ini -c ';' \ tools/editconf.py /etc/php/7.0/fpm/php.ini -c ';' \
default_charset="UTF-8" default_charset="UTF-8"
# Switch from the dynamic process manager to the ondemand manager see #1215
tools/editconf.py /etc/php/7.0/fpm/pool.d/www.conf -c ';' \
pm = ondemand
# Bump up PHP's max_children to support more concurrent connections # Bump up PHP's max_children to support more concurrent connections
tools/editconf.py /etc/php/7.0/fpm/pool.d/www.conf -c ';' \ tools/editconf.py /etc/php/7.0/fpm/pool.d/www.conf -c ';' \
pm.max_children=8 pm.max_children=8