Docs: Document reasonable Postgres settings.
authorlain <lain@soykaf.club>
Mon, 25 May 2020 13:53:14 +0000 (15:53 +0200)
committerlain <lain@soykaf.club>
Mon, 25 May 2020 13:53:14 +0000 (15:53 +0200)
docs/configuration/postgresql.md [new file with mode: 0644]
docs/installation/otp_en.md

diff --git a/docs/configuration/postgresql.md b/docs/configuration/postgresql.md
new file mode 100644 (file)
index 0000000..068f133
--- /dev/null
@@ -0,0 +1,31 @@
+# Optimizing your Postgresql performance
+
+Pleroma performance depends to a large extent on good database performance. The default Postgresql settings are mostly fine, but often you can get better performance by changing a few settings.
+
+You can use [PGTune](https://pgtune.leopard.in.ua) to get recommendations for your setup. If you do, set the "Number of Connections" field to 20, as Pleroma will only use 10 concurrent connections anyway. If you don't, it will give you advice that might even hurt your performance.
+
+We also recommend not using the "Network Storage" option.
+
+## Example configurations
+
+Here are some configuration suggestions for Postgresql 10+.
+
+### 1GB RAM, 1 CPU
+```
+shared_buffers = 256MB
+effective_cache_size = 768MB
+maintenance_work_mem = 64MB
+work_mem = 13107kB
+```
+
+### 2GB RAM, 2 CPU
+```
+shared_buffers = 512MB
+effective_cache_size = 1536MB
+maintenance_work_mem = 128MB
+work_mem = 26214kB
+max_worker_processes = 2
+max_parallel_workers_per_gather = 1
+max_parallel_workers = 2
+```
+
index fb99af6993290b62aca2ba3196f274c471bcb7bc..b627bbb7ab0a89be7a5438ab3a87c4e8e5ec4ee1 100644 (file)
@@ -63,7 +63,7 @@ apt install postgresql-11-rum
 ```
 
 #### (Optional) Performance configuration
-For optimal performance, you may use [PGTune](https://pgtune.leopard.in.ua), don't forget to restart postgresql after editing the configuration
+Check out our Postgresql document for a guide on optimizing Postgresql performance settings.
 
 ```sh tab="Alpine"
 rc-service postgresql restart