Mox mode setup tweak; refactoring.
[akkoma] / docs / configuration / postgresql.md
1 # Optimizing your PostgreSQL performance
2
3 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.
4
5 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.
6
7 We also recommend not using the "Network Storage" option.
8
9 ## Example configurations
10
11 Here are some configuration suggestions for PostgreSQL 10+.
12
13 ### 1GB RAM, 1 CPU
14 ```
15 shared_buffers = 256MB
16 effective_cache_size = 768MB
17 maintenance_work_mem = 64MB
18 work_mem = 13107kB
19 ```
20
21 ### 2GB RAM, 2 CPU
22 ```
23 shared_buffers = 512MB
24 effective_cache_size = 1536MB
25 maintenance_work_mem = 128MB
26 work_mem = 26214kB
27 max_worker_processes = 2
28 max_parallel_workers_per_gather = 1
29 max_parallel_workers = 2
30 ```
31