add ability to set php-workers/servers/children

This commit is contained in:
2018-06-07 11:46:47 +02:00
parent 1a6bfd4039
commit 75b811dac0
9 changed files with 40 additions and 8 deletions

View File

@ -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 \

View File

@ -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 \

View File

@ -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 \

View File

@ -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)*

View File

@ -6,7 +6,11 @@ sed -i -e "s/<APC_SHM_SIZE>/$APC_SHM_SIZE/g" /php/conf.d/apcu.ini \
-e "s/<CRON_PERIOD>/$CRON_PERIOD/g" /etc/s6.d/cron/run \
-e "s/<MEMORY_LIMIT>/$MEMORY_LIMIT/g" /usr/local/bin/occ \
-e "s/<UPLOAD_MAX_SIZE>/$UPLOAD_MAX_SIZE/g" /nginx/conf/nginx.conf /php/etc/php-fpm.conf \
-e "s/<MEMORY_LIMIT>/$MEMORY_LIMIT/g" /php/etc/php-fpm.conf
-e "s/<MEMORY_LIMIT>/$MEMORY_LIMIT/g" /php/etc/php-fpm.conf \
-e "s/<PHP_MAX_CHILDREN>/$PHP_MAX_CHILDREN/g" /php/etc/php-fpm.conf \
-e "s/<PHP_START_SERVERS>/$PHP_START_SERVERS/g" /php/etc/php-fpm.conf \
-e "s/<PHP_MIN_SPARE_SERVERS>/$PHP_MIN_SPARE_SERVERS/g" /php/etc/php-fpm.conf \
-e "s/<PHP_MAX_SPARE_SERVERS>/$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