From 652185f380f0de3fa4a070b9a443d266d008356e Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
Date: Tue, 1 Jun 2021 18:44:21 +0200
Subject: [PATCH] matrix: Retune memory use a bit

Give more memory to the apps and less to postgres.
---
 playbooks/matrix.archlinux.org.yml        | 2 +-
 roles/matrix/templates/homeserver.yaml.j2 | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/playbooks/matrix.archlinux.org.yml b/playbooks/matrix.archlinux.org.yml
index 5c5ce6dc5..c4140d871 100644
--- a/playbooks/matrix.archlinux.org.yml
+++ b/playbooks/matrix.archlinux.org.yml
@@ -13,7 +13,7 @@
     - { role: certbot }
     - { role: nginx }
     - role: postgres
-      postgres_shared_buffers: 1GB
+      postgres_shared_buffers: 256MB
       postgres_work_mem: 64MB
       postgres_maintenance_work_mem: 256MB
       postgres_effective_cache_size: 4GB
diff --git a/roles/matrix/templates/homeserver.yaml.j2 b/roles/matrix/templates/homeserver.yaml.j2
index 00625323f..1c8121098 100644
--- a/roles/matrix/templates/homeserver.yaml.j2
+++ b/roles/matrix/templates/homeserver.yaml.j2
@@ -773,7 +773,7 @@ caches:
    #
    # Defaults to 0.5, which will half the size of all caches.
    #
-   #global_factor: 1.0
+   global_factor: 0.7
 
    # A dictionary of cache name to cache factor for that individual
    # cache. Overrides the global cache factor for a given cache.
@@ -840,7 +840,7 @@ database:
     user: synapse
     password: {{ vault_postgres_users.synapse }}
     cp_min: 1
-    cp_max: 5
+    cp_max: 8
 
 
 ## Logging ##
-- 
GitLab