diff --git a/matomo/Dockerfile b/matomo/Dockerfile index 5e11f80..8787def 100644 --- a/matomo/Dockerfile +++ b/matomo/Dockerfile @@ -6,7 +6,11 @@ ARG GPG_matthieu="814E 346F A01A 20DB B04B 6807 B5DB D592 5590 A237" ENV UID=991 GID=991 \ UPLOAD_MAX_SIZE=10M \ MEMORY_LIMIT=256M \ - OPCACHE_MEM_SIZE=128M + OPCACHE_MEM_SIZE=128M \ + PHP_MAX_CHILDREN=15 \ + PHP_START_SERVERS=2 \ + PHP_MIN_SPARE_SERVERS=1 \ + PHP_MAX_SPARE_SERVERS=6 RUN BUILD_DEPS=" \ git \ diff --git a/matomo/rootfs/usr/local/bin/run.sh b/matomo/rootfs/usr/local/bin/run.sh index c49e1f6..d2c6a43 100644 --- a/matomo/rootfs/usr/local/bin/run.sh +++ b/matomo/rootfs/usr/local/bin/run.sh @@ -1,7 +1,11 @@ #!/bin/sh sed -i -e "s//$UPLOAD_MAX_SIZE/g" /nginx/conf/nginx.conf /php/etc/php-fpm.conf \ -e "s//$MEMORY_LIMIT/g" /php/etc/php-fpm.conf \ - -e "s//$OPCACHE_MEM_SIZE/g" /php/conf.d/opcache.ini + -e "s//$OPCACHE_MEM_SIZE/g" /php/conf.d/opcache.ini \ + -e "s//$PHP_MAX_CHILDREN/g" /php/etc/php-fpm.conf \ + -e "s//$PHP_START_SERVERS/g" /php/etc/php-fpm.conf \ + -e "s//$PHP_MIN_SPARE_SERVERS/g" /php/etc/php-fpm.conf \ + -e "s//$PHP_MAX_SPARE_SERVERS/g" /php/etc/php-fpm.conf if [ ! -f /config/config.ini.php ]; then cp /matomo/config/config.ini.php /config/config.ini.php diff --git a/nextcloud/Dockerfile.12.0 b/nextcloud/Dockerfile.12.0 index 46d37bc..2da51fd 100644 --- a/nextcloud/Dockerfile.12.0 +++ b/nextcloud/Dockerfile.12.0 @@ -8,6 +8,10 @@ ENV UID=991 GID=991 \ APC_SHM_SIZE=128M \ OPCACHE_MEM_SIZE=128 \ MEMORY_LIMIT=512M \ + PHP_MAX_CHILDREN=15 \ + PHP_START_SERVERS=2 \ + PHP_MIN_SPARE_SERVERS=1 \ + PHP_MAX_SPARE_SERVERS=6 \ CRON_PERIOD=15m \ CRON_MEMORY_LIMIT=1g \ TZ=Etc/UTC \ diff --git a/nextcloud/Dockerfile.13.0 b/nextcloud/Dockerfile.13.0 index 16060aa..e51b2c5 100644 --- a/nextcloud/Dockerfile.13.0 +++ b/nextcloud/Dockerfile.13.0 @@ -8,6 +8,10 @@ ENV UID=991 GID=991 \ APC_SHM_SIZE=128M \ OPCACHE_MEM_SIZE=128 \ MEMORY_LIMIT=512M \ + PHP_MAX_CHILDREN=15 \ + PHP_START_SERVERS=2 \ + PHP_MIN_SPARE_SERVERS=1 \ + PHP_MAX_SPARE_SERVERS=6 \ CRON_PERIOD=15m \ CRON_MEMORY_LIMIT=1g \ TZ=Etc/UTC \ diff --git a/nextcloud/Dockerfile.daily b/nextcloud/Dockerfile.daily index 15dd0b0..550ca5a 100644 --- a/nextcloud/Dockerfile.daily +++ b/nextcloud/Dockerfile.daily @@ -5,6 +5,10 @@ ENV UID=991 GID=991 \ APC_SHM_SIZE=128M \ OPCACHE_MEM_SIZE=128 \ MEMORY_LIMIT=512M \ + PHP_MAX_CHILDREN=15 \ + PHP_START_SERVERS=2 \ + PHP_MIN_SPARE_SERVERS=1 \ + PHP_MAX_SPARE_SERVERS=6 \ CRON_PERIOD=15m \ CRON_MEMORY_LIMIT=1g \ TZ=Etc/UTC \ diff --git a/nextcloud/README.md b/nextcloud/README.md index 6a10501..63f042d 100644 --- a/nextcloud/README.md +++ b/nextcloud/README.md @@ -43,6 +43,10 @@ Other tags than `daily` are built weekly. For security reasons, you should occas - **APC_SHM_SIZE** : apc memory size *(default : 128M)* - **OPCACHE_MEM_SIZE** : opcache memory size in megabytes *(default : 128)* - **MEMORY_LIMIT** : php memory limit *(default : 512M)* +- **PHP_MAX_CHILDREN** : php max child processes *(default : 15)* +- **PHP_START_SERVERS** : php number of processes on startup *(default : 2)* +- **PHP_MIN_SPARE_SERVERS** : php min of idle processes *(default : 1)* +- **PHP_MAX_SPARE_SERVERS** : php max of idle processes *(default : 6)* - **CRON_PERIOD** : time interval between two cron tasks *(default : 15m)* - **CRON_MEMORY_LIMIT** : memory limit for PHP when executing cronjobs *(default : 1024m)* - **TZ** : the system/log timezone *(default : Etc/UTC)* diff --git a/nextcloud/rootfs/usr/local/bin/run.sh b/nextcloud/rootfs/usr/local/bin/run.sh index 673c121..6accca2 100644 --- a/nextcloud/rootfs/usr/local/bin/run.sh +++ b/nextcloud/rootfs/usr/local/bin/run.sh @@ -6,7 +6,11 @@ sed -i -e "s//$APC_SHM_SIZE/g" /php/conf.d/apcu.ini \ -e "s//$CRON_PERIOD/g" /etc/s6.d/cron/run \ -e "s//$MEMORY_LIMIT/g" /usr/local/bin/occ \ -e "s//$UPLOAD_MAX_SIZE/g" /nginx/conf/nginx.conf /php/etc/php-fpm.conf \ - -e "s//$MEMORY_LIMIT/g" /php/etc/php-fpm.conf + -e "s//$MEMORY_LIMIT/g" /php/etc/php-fpm.conf \ + -e "s//$PHP_MAX_CHILDREN/g" /php/etc/php-fpm.conf \ + -e "s//$PHP_START_SERVERS/g" /php/etc/php-fpm.conf \ + -e "s//$PHP_MIN_SPARE_SERVERS/g" /php/etc/php-fpm.conf \ + -e "s//$PHP_MAX_SPARE_SERVERS/g" /php/etc/php-fpm.conf # Put the configuration and apps into volumes ln -sf /config/config.php /nextcloud/config/config.php &>/dev/null diff --git a/nginx-php/rootfs/php/etc/php-fpm.conf b/nginx-php/rootfs/php/etc/php-fpm.conf index 215e264..4e68ce2 100644 --- a/nginx-php/rootfs/php/etc/php-fpm.conf +++ b/nginx-php/rootfs/php/etc/php-fpm.conf @@ -5,10 +5,10 @@ error_log = /php/logs/error.log [www] listen = /php/run/php-fpm.sock pm = dynamic -pm.max_children = 15 -pm.start_servers = 2 -pm.min_spare_servers = 1 -pm.max_spare_servers = 6 +pm.max_children = +pm.start_servers = +pm.min_spare_servers = +pm.max_spare_servers = chdir = / request_terminate_timeout = 0 env[PATH] = /usr/local/bin:/usr/bin:/bin diff --git a/privatebin/Dockerfile b/privatebin/Dockerfile index f0a9208..acccfb2 100644 --- a/privatebin/Dockerfile +++ b/privatebin/Dockerfile @@ -4,7 +4,11 @@ ARG PRIVATEBIN_VER=1.1.1 ENV GID=991 UID=991 \ UPLOAD_MAX_SIZE=10M \ - MEMORY_LIMIT=128M + MEMORY_LIMIT=128M \ + PHP_MAX_CHILDREN=15 \ + PHP_START_SERVERS=2 \ + PHP_MIN_SPARE_SERVERS=1 \ + PHP_MAX_SPARE_SERVERS=6 RUN BUILD_DEPS="tar libressl ca-certificates" \ && apk -U upgrade && apk add $BUILD_DEPS \