From e2860e52921e93f0610a09019dcd1dc396696255 Mon Sep 17 00:00:00 2001 From: Norm Date: Thu, 6 Jun 2024 12:11:54 -0400 Subject: [PATCH] Update PGTune recommendations From experience, setting DB type to "Online transaction processing system" seems to give the most optimal configuration in terms of performance. I also increased the recomended max connections to 25-30 as that leaves some room for maintenance tasks to run without running out of connections. Finally, I removed the example configs since they're probably out of date and I think it's better to direct people to use PGTune instead. --- docs/docs/configuration/postgresql.md | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/docs/docs/configuration/postgresql.md b/docs/docs/configuration/postgresql.md index 3d5b78c0d..6e4596603 100644 --- a/docs/docs/configuration/postgresql.md +++ b/docs/docs/configuration/postgresql.md @@ -4,32 +4,13 @@ Akkoma performance is largely dependent on performance of the underlying databas ## PGTune -[PgTune](https://pgtune.leopard.in.ua) can be used to get recommended settings. Be sure to set "Number of Connections" to 20, otherwise it might produce settings hurtful to database performance. It is also recommended to not use "Network Storage" option. +[PgTune](https://pgtune.leopard.in.ua) can be used to get recommended settings. Make sure to set the DB type to "Online transaction processing system" for optimal performance. Also set the number of connections to between 25 and 30. This will allow each connection to have access to more resources while still leaving some room for running maintenance tasks while the instance is still running. -If your server runs other services, you may want to take that into account. E.g. if you have 4G ram, but 1G of it is already used for other services, it may be better to tell PGTune you only have 3G. In the end, PGTune only provides recomended settings, you can always try to finetune further. +It is also recommended to not use "Network Storage" option. -### Example configurations +If your server runs other services, you may want to take that into account. E.g. if you have 4G ram, but 1G of it is already used for other services, it may be better to tell PGTune you only have 3G. -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 -``` +In the end, PGTune only provides recomended settings, you can always try to finetune further. ## Disable generic query plans -- 2.43.0