From 805b29d918f122977ce32eed43943edae4d7226d Mon Sep 17 00:00:00 2001 From: Philipp Rothmann Date: Tue, 13 Dec 2022 15:20:57 +0100 Subject: [PATCH] feat: template fpm settings this closes #25 --- .env.sample | 10 ++++++++-- abra.sh | 2 +- compose.yml | 5 +++++ fpm-tune.ini | 8 ++++---- releases/next | 20 +++++++++++++++++++- 5 files changed, 37 insertions(+), 8 deletions(-) diff --git a/.env.sample b/.env.sample index 4388ad9..0b019a0 100644 --- a/.env.sample +++ b/.env.sample @@ -17,6 +17,13 @@ SECRET_ADMIN_PASSWORD_VERSION=v1 EXTRA_VOLUME=/dev/null:/tmp/.dummy +# fpm-tune, see: https://spot13.com/pmcalculator/ +FPM_MAX_CHILDREN=131 +FPM_START_SERVERS=32 +FPM_MIN_SPARE_SERVERS=32 +FPM_MAX_SPARE_SERVERS=98 + + # COMPOSE_FILE="$COMPOSE_FILE:compose.smtp.yml" # See https://github.com/nextcloud/docker#auto-configuration-via-environment-variables for default values # SMTP_AUTHTYPE= @@ -36,7 +43,6 @@ EXTRA_VOLUME=/dev/null:/tmp/.dummy # # ONLYOFFICE_URL=https://onlyoffice.example.com # SECRET_ONLYOFFICE_JWT_VERSION=v1 -# +# # BBB_URL=https://talk.example.org/bigbluebutton/ # trailing slash! # SECRET_BBB_SECRET_VERSION=v1 - diff --git a/abra.sh b/abra.sh index 8f018e4..bac609d 100644 --- a/abra.sh +++ b/abra.sh @@ -1,6 +1,6 @@ #!/bin/bash -export FPM_TUNE_VERSION=v4 +export FPM_TUNE_VERSION=v5 export NGINX_CONF_VERSION=v4 export MY_CNF_VERSION=v4 export ENTRYPOINT_VERSION=v3 diff --git a/compose.yml b/compose.yml index ca80a7f..86b786e 100644 --- a/compose.yml +++ b/compose.yml @@ -61,6 +61,10 @@ services: - REDIS_HOST=cache - OVERWRITEPROTOCOL=https - PHP_MEMORY_LIMIT=1G + - FPM_MAX_CHILDREN=131 + - FPM_START_SERVERS=32 + - FPM_MIN_SPARE_SERVERS=32 + - FPM_MAX_SPARE_SERVERS=98 volumes: - nextcloud:/var/www/html/ - nextapps:/var/www/html/custom_apps:cached @@ -124,6 +128,7 @@ configs: fpm_tune: name: ${STACK_NAME}_fpm_tune_${FPM_TUNE_VERSION} file: fpm-tune.ini + template_driver: golang entrypoint: name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_VERSION} file: entrypoint.sh.tmpl diff --git a/fpm-tune.ini b/fpm-tune.ini index 8e0fc5c..af0f58d 100644 --- a/fpm-tune.ini +++ b/fpm-tune.ini @@ -1,5 +1,5 @@ pm = dynamic -pm.max_children = 131 -pm.start_servers = 32 -pm.min_spare_servers = 32 -pm.max_spare_servers = 98 +pm.max_children = {{ env "FPM_MAX_CHILDREN" }} +pm.start_servers = {{ env "FPM_START_SERVERS" }} +pm.min_spare_servers = {{ env "FPM_MIN_SPARE_SERVERS" }} +pm.max_spare_servers = {{ env "FPM_MAX_SPARE_SERVERS" }} diff --git a/releases/next b/releases/next index 112b1f9..684f01f 100644 --- a/releases/next +++ b/releases/next @@ -1,6 +1,21 @@ + +## FPM Tune + +The fpm-tune.ini settings are now configurable by `.env`. Please add this to your servers configs: + +``` +# fpm-tune, see: https://spot13.com/pmcalculator/ +FPM_MAX_CHILDREN=131 +FPM_START_SERVERS=32 +FPM_MIN_SPARE_SERVERS=32 +FPM_MAX_SPARE_SERVERS=98 +``` + +## SMTP + Add SMTP Config to your .env file: -``` +``` # COMPOSE_FILE="$COMPOSE_FILE:compose.smtp.yml" # See https://github.com/nextcloud/docker#auto-configuration-via-environment-variables for default values # SMTP_AUTHTYPE= @@ -13,6 +28,9 @@ Add SMTP Config to your .env file: # SECRET_SMTP_PASSWORD_VERSION=v1 ``` + +## Post Deploy Commands + Some Apps can also be managed with abra app cmd! ```