mermet: pleroma: increase DB timeout
authorJulien Moutinho <julm+sourcephile-nix@sourcephile.fr>
Sun, 30 Jun 2024 20:56:17 +0000 (22:56 +0200)
committerJulien Moutinho <julm+sourcephile-nix@sourcephile.fr>
Sun, 30 Jun 2024 20:56:17 +0000 (22:56 +0200)
hosts/mermet/pleroma.nix
hosts/mermet/postgresql.nix

index 3293106f3f313002fc35b2a4ba5675599367800d..c0762f27af836f13b8d876f10523f2e3e2b72042 100644 (file)
@@ -64,6 +64,12 @@ let
       socket_dir: "/run/postgresql",
       database: "${db}",
       pool_size: 5,
+      # Database task queue timeout to avoid timeouts on the front end
+      # due to a slow postgresql, eg. because of a CPUQuota= hardening.
+      queue_target: 20_000,
+      queue_interval: 1_000,
+      ownership_timeout: 20_000,
+      timeout: 40_000,
       prepare: :named,
       # https://docs-develop.pleroma.social/backend/configuration/postgresql/#disable-generic-query-plans
       parameters: [
index 2522fb8ffd615910997f3916353ab095e916333c..99185c40f0415ce072f795c3de62d3eaa958df4e 100644 (file)
@@ -109,6 +109,9 @@ in
   };
   systemd.services.postgresql = {
     serviceConfig = {
+      CPUAccounting = true;
+      #CPUWeight = "idle";
+      CPUQuota = "75%";
       MemoryAccounting = true;
       MemoryHigh = "500M";
       MemoryMax = "600M";