From c7ccfc5f9ff3904c22c905c7bc0ef46fc03faa7e Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 29 Dec 2024 21:58:00 +0100 Subject: [PATCH 1/3] nixos/nextcloud: drop default for `dbtype` setting Closes #355606 To quote the system requirements[1]: > Database: SQLite 3.16+ (only recommended for testing and minimal-instances) As discussed[2], this would already fail at eval-time for everyone and makes all sqlite users aware that this is probably not the best choice. Doing that regardless, is now an explicit decision. [1] https://docs.nextcloud.com/server/30/admin_manual/installation/system_requirements.html [2] https://github.com/NixOS/nixpkgs/pull/369242#discussion_r1899706512 --- nixos/doc/manual/release-notes/rl-2505.section.md | 5 +++++ nixos/modules/services/web-apps/nextcloud.nix | 1 - nixos/tests/nextcloud/basic.nix | 1 + nixos/tests/nextcloud/with-objectstore.nix | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index f974d5836b17..1b1d58e01358 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -111,6 +111,11 @@ - `ps3-disc-dumper` was updated to 4.2.5, which removed the CLI project and now exclusively offers the GUI +- [](#opt-services.nextcloud.config.dbtype) is unset by default, the previous default was `sqlite`. + This was done because `sqlite` is not a reasonable default since it's + [not recommended by upstream](https://docs.nextcloud.com/server/30/admin_manual/installation/system_requirements.html) + and thus doesn't qualify as default. + - `asusd` has been upgraded to version 6 which supports multiple aura devices. To account for this, the single `auraConfig` configuration option has been replaced with `auraConfigs` which is an attribute set of config options per each device. The config files may also be now specified as either source files or text strings; to account for this you will need to specify that `text` is used for your existing configs, e.g.: ```diff -services.asusd.asusdConfig = '''file contents''' diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index eae005bca545..595244d8de9c 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -416,7 +416,6 @@ in { config = { dbtype = mkOption { type = types.enum [ "sqlite" "pgsql" "mysql" ]; - default = "sqlite"; description = "Database type."; }; dbname = mkOption { diff --git a/nixos/tests/nextcloud/basic.nix b/nixos/tests/nextcloud/basic.nix index f8306503d85f..217f22714c1c 100644 --- a/nixos/tests/nextcloud/basic.nix +++ b/nixos/tests/nextcloud/basic.nix @@ -59,6 +59,7 @@ runTest ( services.nextcloud = { enable = true; + config.dbtype = "sqlite"; datadir = "/var/lib/nextcloud-data"; autoUpdateApps = { enable = true; diff --git a/nixos/tests/nextcloud/with-objectstore.nix b/nixos/tests/nextcloud/with-objectstore.nix index 48e1edea67ba..5f24fc48851c 100644 --- a/nixos/tests/nextcloud/with-objectstore.nix +++ b/nixos/tests/nextcloud/with-objectstore.nix @@ -36,6 +36,8 @@ runTest ( networking.firewall.allowedTCPPorts = [ 9000 ]; environment.systemPackages = [ pkgs.minio-client ]; + services.nextcloud.config.dbtype = "sqlite"; + services.nextcloud.config.objectstore.s3 = { enable = true; bucket = "nextcloud"; From 6978b4b5bdeac0ae6415fe80e3f83621510e6cde Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 29 Dec 2024 22:56:09 +0100 Subject: [PATCH 2/3] nixos/nextcloud: increase pool settings Also link to upstream docs about PHP-FPM tuning[1]. These seem a little more reasonable performance-wise, but are still conservative enough for small setups. [1] https://docs.nextcloud.com/server/30/admin_manual/installation/server_tuning.html#tune-php-fpm --- nixos/doc/manual/release-notes/rl-2505.section.md | 4 ++++ nixos/modules/services/web-apps/nextcloud.nix | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 1b1d58e01358..529ea9cbef8c 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -116,6 +116,10 @@ [not recommended by upstream](https://docs.nextcloud.com/server/30/admin_manual/installation/system_requirements.html) and thus doesn't qualify as default. +- Nextcloud's default FPM pool settings have been increased according to upstream recommentations. It's advised + to review the new defaults and description of + [](#opt-services.nextcloud.poolSettings). + - `asusd` has been upgraded to version 6 which supports multiple aura devices. To account for this, the single `auraConfig` configuration option has been replaced with `auraConfigs` which is an attribute set of config options per each device. The config files may also be now specified as either source files or text strings; to account for this you will need to specify that `text` is used for your existing configs, e.g.: ```diff -services.asusd.asusdConfig = '''file contents''' diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index 595244d8de9c..64c17aa44b4a 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -374,14 +374,18 @@ in { type = with types; attrsOf (oneOf [ str int bool ]); default = { "pm" = "dynamic"; - "pm.max_children" = "32"; - "pm.start_servers" = "2"; - "pm.min_spare_servers" = "2"; - "pm.max_spare_servers" = "4"; + "pm.max_children" = "120"; + "pm.start_servers" = "12"; + "pm.min_spare_servers" = "6"; + "pm.max_spare_servers" = "18"; "pm.max_requests" = "500"; }; description = '' - Options for nextcloud's PHP pool. See the documentation on `php-fpm.conf` for details on configuration directives. + Options for nextcloud's PHP pool. See the documentation on `php-fpm.conf` for details on + configuration directives. The above are recommended for a server with 4GiB of RAM. + + It's advisable to read the [section about PHPFPM tuning in the upstream manual](https://docs.nextcloud.com/server/30/admin_manual/installation/server_tuning.html#tune-php-fpm) + and consider customizing the values. ''; }; From b95a9171dd50a87a2a8b789ca812a545d2d8158b Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Mon, 30 Dec 2024 23:54:35 +0100 Subject: [PATCH 3/3] nixos/nextcloud: don't use pg14 for tests This currently fails to build, so we just update it now to make sure all tests are green with the current changes. --- nixos/tests/nextcloud/with-declarative-redis-and-secrets.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nixos/tests/nextcloud/with-declarative-redis-and-secrets.nix b/nixos/tests/nextcloud/with-declarative-redis-and-secrets.nix index 6b0dd71f85ef..74343a22b7ae 100644 --- a/nixos/tests/nextcloud/with-declarative-redis-and-secrets.nix +++ b/nixos/tests/nextcloud/with-declarative-redis-and-secrets.nix @@ -69,14 +69,13 @@ runTest ( services.postgresql = { enable = true; - package = pkgs.postgresql_14; }; systemd.services.postgresql.postStart = pkgs.lib.mkAfter '' password=$(cat ${config.services.nextcloud.config.dbpassFile}) ${config.services.postgresql.package}/bin/psql <