summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--flake.lock173
-rwxr-xr-xhost/Rory-nginx/services/matrix/synapse.nix14
-rwxr-xr-xhost/Rory-nginx/services/postgres.nix24
3 files changed, 71 insertions, 140 deletions
diff --git a/flake.lock b/flake.lock
index d5aeb56..429836f 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,30 +1,11 @@
 {
   "nodes": {
-    "MatrixMediaGate": {
-      "inputs": {
-        "flake-utils": "flake-utils",
-        "nixpkgs": "nixpkgs"
-      },
-      "locked": {
-        "lastModified": 1708849238,
-        "narHash": "sha256-row//i4aghEYHWwsMVCKF+5IRCktHLk8H0va8+YiXt0=",
-        "ref": "refs/heads/master",
-        "rev": "766e1eef3b6a24bf45b46c014b07aed0ed139503",
-        "revCount": 2,
-        "type": "git",
-        "url": "https://cgit.rory.gay/matrix/MatrixMediaGate.git/"
-      },
-      "original": {
-        "type": "git",
-        "url": "https://cgit.rory.gay/matrix/MatrixMediaGate.git/"
-      }
-    },
     "attic": {
       "inputs": {
         "crane": "crane",
         "flake-compat": "flake-compat",
-        "flake-utils": "flake-utils_2",
-        "nixpkgs": "nixpkgs_3",
+        "flake-utils": "flake-utils",
+        "nixpkgs": "nixpkgs_2",
         "nixpkgs-stable": "nixpkgs-stable"
       },
       "locked": {
@@ -44,7 +25,7 @@
     },
     "botcore-v4": {
       "inputs": {
-        "nixpkgs": "nixpkgs_2"
+        "nixpkgs": "nixpkgs"
       },
       "locked": {
         "lastModified": 1683656302,
@@ -67,18 +48,18 @@
         "crane": "crane_2",
         "fenix": "fenix",
         "flake-compat": "flake-compat_2",
-        "flake-utils": "flake-utils_3",
+        "flake-utils": "flake-utils_2",
         "nix-filter": "nix-filter",
         "nixpkgs": [
           "nixpkgs"
         ]
       },
       "locked": {
-        "lastModified": 1708926554,
-        "narHash": "sha256-NRfhf/+Scj23L6HysGoFT9+CQmegHCec91OxKFeSg+0=",
+        "lastModified": 1710602287,
+        "narHash": "sha256-6hjHSfH3jfTDxD6hELL7RGoqv2pnyVAtS81H5Le6qkk=",
         "owner": "girlbossceo",
         "repo": "conduwuit",
-        "rev": "ca281b21db6640890828d2b6db743e9db33cc012",
+        "rev": "930bf3891c5a1279b23e16f3f10ce02c47b9b4cb",
         "type": "github"
       },
       "original": {
@@ -126,8 +107,8 @@
       },
       "original": {
         "owner": "ipetkov",
-        "ref": "master",
         "repo": "crane",
+        "rev": "2c653e4478476a52c6aa3ac0495e4dea7449ea0e",
         "type": "github"
       }
     },
@@ -140,11 +121,11 @@
         "rust-analyzer-src": "rust-analyzer-src"
       },
       "locked": {
-        "lastModified": 1707891749,
-        "narHash": "sha256-SeikNYElHgv8uVMbiA9/pU3Cce7ssIsiM8CnEiwd1Nc=",
+        "lastModified": 1709619709,
+        "narHash": "sha256-l6EPVJfwfelWST7qWQeP6t/TDK3HHv5uUB1b2vw4mOQ=",
         "owner": "nix-community",
         "repo": "fenix",
-        "rev": "3115aab064ef38cccd792c45429af8df43d6d277",
+        "rev": "c8943ea9e98d41325ff57d4ec14736d330b321b2",
         "type": "github"
       },
       "original": {
@@ -202,24 +183,6 @@
       }
     },
     "flake-utils": {
-      "inputs": {
-        "systems": "systems"
-      },
-      "locked": {
-        "lastModified": 1705309234,
-        "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
-        "type": "github"
-      },
-      "original": {
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "type": "github"
-      }
-    },
-    "flake-utils_2": {
       "locked": {
         "lastModified": 1667395993,
         "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
@@ -234,16 +197,16 @@
         "type": "github"
       }
     },
-    "flake-utils_3": {
+    "flake-utils_2": {
       "inputs": {
-        "systems": "systems_2"
+        "systems": "systems"
       },
       "locked": {
-        "lastModified": 1705309234,
-        "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
+        "lastModified": 1709126324,
+        "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=",
         "owner": "numtide",
         "repo": "flake-utils",
-        "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
+        "rev": "d465f4819400de7c8d874d50b982301f28a84605",
         "type": "github"
       },
       "original": {
@@ -252,9 +215,9 @@
         "type": "github"
       }
     },
-    "flake-utils_4": {
+    "flake-utils_3": {
       "inputs": {
-        "systems": "systems_3"
+        "systems": "systems_2"
       },
       "locked": {
         "lastModified": 1705309234,
@@ -272,14 +235,14 @@
     },
     "home-manager": {
       "inputs": {
-        "nixpkgs": "nixpkgs_4"
+        "nixpkgs": "nixpkgs_3"
       },
       "locked": {
-        "lastModified": 1708806879,
-        "narHash": "sha256-MSbxtF3RThI8ANs/G4o1zIqF5/XlShHvwjl9Ws0QAbI=",
+        "lastModified": 1710796387,
+        "narHash": "sha256-ve/vpbby+4LPJrlNGqGyuzZMLL7zHUZhvvKu1StsaC8=",
         "owner": "nix-community",
         "repo": "home-manager",
-        "rev": "4ee704cb13a5a7645436f400b9acc89a67b9c08a",
+        "rev": "baf7659448ffa6ab6870dba1ca681a4868c3068a",
         "type": "github"
       },
       "original": {
@@ -292,11 +255,11 @@
     "mtxclientSrc": {
       "flake": false,
       "locked": {
-        "lastModified": 1708709484,
-        "narHash": "sha256-gDnashMX05xYimPAnKWR5+F/bLYKwHDlhCoQgpwVjVQ=",
+        "lastModified": 1710558918,
+        "narHash": "sha256-N92nf1Ay27auUQR9pZSXx4HMFCG9UGTBei+Eva18TLU=",
         "owner": "Nheko-reborn",
         "repo": "mtxclient",
-        "rev": "158e991f537184ebb197341f8b77e5462de9f89d",
+        "rev": "4fb7d678aeea197d16b52bfb1dc35b506673bb52",
         "type": "github"
       },
       "original": {
@@ -309,11 +272,11 @@
     "nhekoSrc": {
       "flake": false,
       "locked": {
-        "lastModified": 1708201985,
-        "narHash": "sha256-5Ng6lPJCJHpTyXY+Na2mwDzXODudFBGCIxR6UT1sVxw=",
+        "lastModified": 1710586292,
+        "narHash": "sha256-60D9LZg7WiJmQ2BOIbiTP/ftWmPRLWzu2/CoLmXqBTM=",
         "owner": "Nheko-reborn",
         "repo": "nheko",
-        "rev": "0649bc342dea6402dc9ba3d697c3ab9f91eca033",
+        "rev": "6d44c8e30dbdac75b34d05b1de08b2377cffd797",
         "type": "github"
       },
       "original": {
@@ -341,15 +304,15 @@
     "nixos-wsl": {
       "inputs": {
         "flake-compat": "flake-compat_3",
-        "flake-utils": "flake-utils_4",
-        "nixpkgs": "nixpkgs_5"
+        "flake-utils": "flake-utils_3",
+        "nixpkgs": "nixpkgs_4"
       },
       "locked": {
-        "lastModified": 1708788887,
-        "narHash": "sha256-4HprTKLKiY8rXmthsuRAwXHW7hGaXsSlzmbXSWdOa7g=",
+        "lastModified": 1710519878,
+        "narHash": "sha256-0dbc10OBFUVYyXC+C+N6vRUd8xyBSRxkcZ4Egipbx0M=",
         "owner": "nix-community",
         "repo": "NixOS-WSL",
-        "rev": "7e3fc6a99a2c9e6701e2e0d37f1755e29a798b91",
+        "rev": "aef95bdb6800a3a2af7aa7083d6df03067da6592",
         "type": "github"
       },
       "original": {
@@ -360,11 +323,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1708655239,
-        "narHash": "sha256-ZrP/yACUvDB+zbqYJsln4iwotbH6CTZiTkANJ0AgDv4=",
+        "lastModified": 1683408522,
+        "narHash": "sha256-9kcPh6Uxo17a3kK3XCHhcWiV1Yu1kYj22RHiymUhMkU=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "cbc4211f0afffe6dfd2478a62615dd5175a13f9a",
+        "rev": "897876e4c484f1e8f92009fd11b7d988a121a4e7",
         "type": "github"
       },
       "original": {
@@ -376,11 +339,11 @@
     },
     "nixpkgs-RoryNix": {
       "locked": {
-        "lastModified": 1708831307,
-        "narHash": "sha256-0iL/DuGjiUeck1zEaL+aIe2WvA3/cVhp/SlmTcOZXH4=",
+        "lastModified": 1710695816,
+        "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "5bf1cadb72ab4e77cb0b700dab76bcdaf88f706b",
+        "rev": "614b4613980a522ba49f0d194531beddbb7220d3",
         "type": "github"
       },
       "original": {
@@ -424,22 +387,6 @@
     },
     "nixpkgs_2": {
       "locked": {
-        "lastModified": 1683408522,
-        "narHash": "sha256-9kcPh6Uxo17a3kK3XCHhcWiV1Yu1kYj22RHiymUhMkU=",
-        "owner": "nixos",
-        "repo": "nixpkgs",
-        "rev": "897876e4c484f1e8f92009fd11b7d988a121a4e7",
-        "type": "github"
-      },
-      "original": {
-        "owner": "nixos",
-        "ref": "nixos-unstable",
-        "repo": "nixpkgs",
-        "type": "github"
-      }
-    },
-    "nixpkgs_3": {
-      "locked": {
         "lastModified": 1702539185,
         "narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=",
         "owner": "NixOS",
@@ -454,13 +401,13 @@
         "type": "github"
       }
     },
-    "nixpkgs_4": {
+    "nixpkgs_3": {
       "locked": {
-        "lastModified": 1708118438,
-        "narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=",
+        "lastModified": 1709961763,
+        "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80",
+        "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34",
         "type": "github"
       },
       "original": {
@@ -470,7 +417,7 @@
         "type": "github"
       }
     },
-    "nixpkgs_5": {
+    "nixpkgs_4": {
       "locked": {
         "lastModified": 1707514827,
         "narHash": "sha256-Y+wqFkvikpE1epCx57PsGw+M1hX5aY5q/xgk+ebDwxI=",
@@ -486,13 +433,13 @@
         "type": "github"
       }
     },
-    "nixpkgs_6": {
+    "nixpkgs_5": {
       "locked": {
-        "lastModified": 1708807242,
-        "narHash": "sha256-sRTRkhMD4delO/hPxxi+XwLqPn8BuUq6nnj4JqLwOu0=",
+        "lastModified": 1710631334,
+        "narHash": "sha256-rL5LSYd85kplL5othxK5lmAtjyMOBg390sGBTb3LRMM=",
         "owner": "NixOS",
         "repo": "nixpkgs",
-        "rev": "73de017ef2d18a04ac4bfd0c02650007ccb31c2a",
+        "rev": "c75037bbf9093a2acb617804ee46320d6d1fea5a",
         "type": "github"
       },
       "original": {
@@ -504,14 +451,13 @@
     },
     "root": {
       "inputs": {
-        "MatrixMediaGate": "MatrixMediaGate",
         "botcore-v4": "botcore-v4",
         "conduit": "conduit",
         "home-manager": "home-manager",
         "mtxclientSrc": "mtxclientSrc",
         "nhekoSrc": "nhekoSrc",
         "nixos-wsl": "nixos-wsl",
-        "nixpkgs": "nixpkgs_6",
+        "nixpkgs": "nixpkgs_5",
         "nixpkgs-RoryNix": "nixpkgs-RoryNix",
         "nixpkgs-rory": "nixpkgs-rory"
       }
@@ -519,11 +465,11 @@
     "rust-analyzer-src": {
       "flake": false,
       "locked": {
-        "lastModified": 1707849817,
-        "narHash": "sha256-If6T0MDErp3/z7DBlpG4bV46IPP+7BWSlgTI88cmbw0=",
+        "lastModified": 1709571018,
+        "narHash": "sha256-ISFrxHxE0J5g7lDAscbK88hwaT5uewvWoma9TlFmRzM=",
         "owner": "rust-lang",
         "repo": "rust-analyzer",
-        "rev": "a02a219773629686bd8ff123ca1aa995fa50d976",
+        "rev": "9f14343f9ee24f53f17492c5f9b653427e2ad15e",
         "type": "github"
       },
       "original": {
@@ -562,21 +508,6 @@
         "repo": "default",
         "type": "github"
       }
-    },
-    "systems_3": {
-      "locked": {
-        "lastModified": 1681028828,
-        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
-        "owner": "nix-systems",
-        "repo": "default",
-        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
-        "type": "github"
-      },
-      "original": {
-        "owner": "nix-systems",
-        "repo": "default",
-        "type": "github"
-      }
     }
   },
   "root": "root",
diff --git a/host/Rory-nginx/services/matrix/synapse.nix b/host/Rory-nginx/services/matrix/synapse.nix
index df0b172..26c61a1 100755
--- a/host/Rory-nginx/services/matrix/synapse.nix
+++ b/host/Rory-nginx/services/matrix/synapse.nix
@@ -25,16 +25,16 @@
         max_long_retry_delay = "30s";
       };
 
-      event_cache_size = "30K"; #defaults to 10K
+      event_cache_size = "1200K"; #defaults to 10K
       caches = {
-        global_factor = 50.0;
-        cache_entry_ttl = "60m";
+        global_factor = 5000.0;
+        cache_entry_ttl = "12h";
         expire_caches = true;
-        sync_response_cache_duration = "5m";
+        sync_response_cache_duration = "6h";
         cache_autotuning = {
-          max_cache_memory_usage = "4096M";
-          target_cache_memory_usage = "1024M";
-          min_cache_ttl = "30m";
+          max_cache_memory_usage = "65536M";
+          target_cache_memory_usage = "32768M";
+          min_cache_ttl = "6h";
         };
       };
 
diff --git a/host/Rory-nginx/services/postgres.nix b/host/Rory-nginx/services/postgres.nix
index fcfbc65..3545a31 100755
--- a/host/Rory-nginx/services/postgres.nix
+++ b/host/Rory-nginx/services/postgres.nix
@@ -24,15 +24,15 @@
     dataDir = "/mnt/postgres/data";
     settings = {
       # https://pgconfigurator.cybertec.at/
-      max_connections = 100;
+      max_connections = 250;
       superuser_reserved_connections = 3;
 
-      shared_buffers = "8192MB";
-      work_mem = "64MB";
-      maintenance_work_mem = "420MB";
+      shared_buffers = "32565MB";
+      work_mem = "512MB";
+      maintenance_work_mem = "1024MB";
       huge_pages = "try";
-      effective_cache_size = "22GB";
-      effective_io_concurrency = "1";
+      effective_cache_size = "60GB"; #was 22
+      effective_io_concurrency = "8";
       random_page_cost = 4;
 
       # can use this to view stats: SELECT query, total_time, calls, rows FROM pg_stat_statements ORDER BY total_time DESC LIMIT 10;
@@ -44,7 +44,7 @@
 
       wal_level = "replica";
       max_wal_senders = 0;
-      synchronous_commit = "on";
+      synchronous_commit = "off"; #was on
 
       checkpoint_timeout = "15min";
       checkpoint_completion_target = "0.9";
@@ -63,10 +63,10 @@
       bgwriter_lru_multiplier = "2.0";
       bgwriter_flush_after = "0";
 
-      max_worker_processes = "14";
-      max_parallel_workers_per_gather = "7";
-      max_parallel_maintenance_workers = "7";
-      max_parallel_workers = "14";
+      max_worker_processes = "32"; #was 14
+      max_parallel_workers_per_gather = "16"; #was 7
+      max_parallel_maintenance_workers = "16"; #was 7
+      max_parallel_workers = "32"; #was 14
       parallel_leader_participation = "on";
 
       enable_partitionwise_join = "on";
@@ -74,7 +74,7 @@
       jit = "on";
       max_slot_wal_keep_size = "1GB";
       track_wal_io_timing = "on";
-      maintenance_io_concurrency = "1";
+      maintenance_io_concurrency = "4";
       wal_recycle = "on";
 
     };