Skip to content

Commit

Permalink
change php-max-children calculation
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <[email protected]>
  • Loading branch information
szaimen committed Nov 1, 2023
1 parent 2221cc7 commit c85bacc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Containers/nextcloud/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ REDIS_CONF
echo "Setting php max children..."
MEMORY=$(awk '/MemTotal/ {printf "%d", $2/1024}' /proc/meminfo)
PHP_MAX_CHILDREN=$((MEMORY/50))
# 100 is the default, we do not want to go lower than this
if [ "$PHP_MAX_CHILDREN" -lt 100 ]; then
PHP_MAX_CHILDREN=100
fi
if [ -n "$PHP_MAX_CHILDREN" ]; then
sed -i "s/^pm.max_children =.*/pm.max_children = $PHP_MAX_CHILDREN/" /usr/local/etc/php-fpm.d/www.conf
sed -i "s/^;pm.process_idle_timeout =.*/pm.process_idle_timeout = 3s/" /usr/local/etc/php-fpm.d/www.conf
fi

# Check permissions in ncdata
Expand Down

0 comments on commit c85bacc

Please sign in to comment.