diff --git a/nextcloud/Containerfile b/nextcloud/Containerfile index 6ceb927..d35e3e5 100644 --- a/nextcloud/Containerfile +++ b/nextcloud/Containerfile @@ -65,9 +65,14 @@ RUN mv php/php.ini /etc/php/${PHPV:?}/fpm/ && \ ### PostgreSQL ### ### -# configure PostgreSQL access -COPY --chown=postgres:postgres assets/pg_hba.conf ./ -RUN mv pg_hba.conf /etc/postgresql/${PSQLV:?}/main/ +# configure PostgreSQL +COPY --chown=postgres:postgres assets/postgresql ./ +# If the posgresql.conf file contains multiple entries for the same parameter, all but the last one is ignored. +# So we can just append our settings to the already-existing postgresql.conf file. +RUN mv postgresql/pg_hba.conf /etc/postgresql/${PSQLV:?}/main/ & \ + cat postgresql/postgresql.conf >> /etc/postgresql/${PSQLV:?}/main/postgresql.conf + + ### ### Apache diff --git a/nextcloud/assets/pg_hba.conf b/nextcloud/assets/postgresql/pg_hba.conf similarity index 100% rename from nextcloud/assets/pg_hba.conf rename to nextcloud/assets/postgresql/pg_hba.conf diff --git a/nextcloud/assets/postgresql/postgresql.conf b/nextcloud/assets/postgresql/postgresql.conf new file mode 100644 index 0000000..a9e97e9 --- /dev/null +++ b/nextcloud/assets/postgresql/postgresql.conf @@ -0,0 +1,27 @@ +# The following configuration parameters were generated using the PGTune tool +# https://pgtune.leopard.in.ua/ +# parameters: + +# DB Version: 13 +# OS Type: linux +# DB Type: web +# Total Memory (RAM): 16 GB +# CPUs num: 6 +# Data Storage: ssd + +max_connections = 200 +shared_buffers = 4GB +effective_cache_size = 12GB +maintenance_work_mem = 1GB +checkpoint_completion_target = 0.9 +wal_buffers = 16MB +default_statistics_target = 100 +random_page_cost = 1.1 +effective_io_concurrency = 200 +work_mem = 6990kB +min_wal_size = 1GB +max_wal_size = 4GB +max_worker_processes = 6 +max_parallel_workers_per_gather = 3 +max_parallel_workers = 6 +max_parallel_maintenance_workers = 3