summary refs log tree commit diff
path: root/host/Rory-nginx
diff options
context:
space:
mode:
Diffstat (limited to 'host/Rory-nginx')
-rwxr-xr-xhost/Rory-nginx/services/matrix/synapse.nix14
-rwxr-xr-xhost/Rory-nginx/services/postgres.nix24
2 files changed, 19 insertions, 19 deletions
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";
 
     };