Skip to content

Commit

Permalink
Merge pull request #168 from crazy-max/pm-max-children
Browse files Browse the repository at this point in the history
add PM_MAX_CHILDREN env var
  • Loading branch information
crazy-max authored Jul 5, 2024
2 parents 8e5eff7 + c918476 commit 315fa7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Image: crazymax/nextcloud:latest
* `PGID`: Nextcloud group id (default `1000`)
* `MEMORY_LIMIT`: PHP memory limit (default `512M`)
* `UPLOAD_MAX_SIZE`: Upload max size (default `512M`)
* `PM_MAX_CHILDREN`: Maximum number of child processes to be created for PHP-FPM (default `20`)
* `BODY_TIMEOUT`: Defines a timeout for reading client request body (default `300s`)
* `CLEAR_ENV`: Clear environment in FPM workers (default `yes`)
* `OPCACHE_MEM_SIZE`: PHP OpCache memory consumption (default `128`)
Expand Down
2 changes: 2 additions & 0 deletions rootfs/etc/cont-init.d/03-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ file_env() {
TZ=${TZ:-UTC}
MEMORY_LIMIT=${MEMORY_LIMIT:-512M}
UPLOAD_MAX_SIZE=${UPLOAD_MAX_SIZE:-512M}
PM_MAX_CHILDREN=${PM_MAX_CHILDREN:-20}
BODY_TIMEOUT=${BODY_TIMEOUT:-300s}
CLEAR_ENV=${CLEAR_ENV:-yes}
OPCACHE_MEM_SIZE=${OPCACHE_MEM_SIZE:-128}
Expand Down Expand Up @@ -63,6 +64,7 @@ echo "Setting PHP-FPM configuration..."
sed -e "s/@MEMORY_LIMIT@/$MEMORY_LIMIT/g" \
-e "s/@UPLOAD_MAX_SIZE@/$UPLOAD_MAX_SIZE/g" \
-e "s/@CLEAR_ENV@/$CLEAR_ENV/g" \
-e "s/@PM_MAX_CHILDREN@/$PM_MAX_CHILDREN/g" \
/tpls/etc/php/php-fpm.d/www.conf >/etc/php/php-fpm.d/www.conf

# PHP
Expand Down
2 changes: 1 addition & 1 deletion rootfs/tpls/etc/php/php-fpm.d/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ listen = /var/run/php-fpm/php-fpm.sock
access.log = /dev/null

pm = dynamic
pm.max_children = 15
pm.max_children = @PM_MAX_CHILDREN@
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 6
Expand Down

0 comments on commit 315fa7e

Please sign in to comment.