aboutsummaryrefslogtreecommitdiff
path: root/docs/configuration/postgresql.md
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-07-02 16:36:54 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-07-02 16:36:54 +0300
commit61180ab6f4b85ab78de2eaf1bc1b974c9e7908af (patch)
tree0970691b2060e06b6feaf4e645021298a7efda0d /docs/configuration/postgresql.md
parent0e23138b50f1fdd9ea78df31eec1b3caac905e2c (diff)
parent4c044f62258b33a95b8281e1eb42a5e0ce47d42d (diff)
downloadpleroma-61180ab6f4b85ab78de2eaf1bc1b974c9e7908af.tar.gz
Merge remote-tracking branch 'remotes/origin/develop' into 2168-media-preview-proxy
# Conflicts: # config/config.exs # lib/pleroma/web/media_proxy/media_proxy.ex # lib/pleroma/web/media_proxy/media_proxy_controller.ex
Diffstat (limited to 'docs/configuration/postgresql.md')
-rw-r--r--docs/configuration/postgresql.md31
1 files changed, 31 insertions, 0 deletions
diff --git a/docs/configuration/postgresql.md b/docs/configuration/postgresql.md
new file mode 100644
index 000000000..6983fb459
--- /dev/null
+++ b/docs/configuration/postgresql.md
@@ -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
+```
+