From 6a85fe1f9d0bfe7aee042671a86c9e58ae2d102b Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 25 May 2020 15:53:14 +0200 Subject: [PATCH 1/3] Docs: Document reasonable Postgres settings. --- docs/configuration/postgresql.md | 31 +++++++++++++++++++++++++++++++ docs/installation/otp_en.md | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 docs/configuration/postgresql.md diff --git a/docs/configuration/postgresql.md b/docs/configuration/postgresql.md new file mode 100644 index 000000000..068f133a9 --- /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 +``` + diff --git a/docs/installation/otp_en.md b/docs/installation/otp_en.md index fb99af699..b627bbb7a 100644 --- a/docs/installation/otp_en.md +++ b/docs/installation/otp_en.md @@ -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 From f7cb3f4cfc7eaf6ff67e27a7d6449e23e09a501e Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 25 May 2020 17:11:35 +0000 Subject: [PATCH 2/3] Apply suggestion to docs/installation/otp_en.md --- docs/installation/otp_en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation/otp_en.md b/docs/installation/otp_en.md index b627bbb7a..6f9749ef1 100644 --- a/docs/installation/otp_en.md +++ b/docs/installation/otp_en.md @@ -63,7 +63,7 @@ apt install postgresql-11-rum ``` #### (Optional) Performance configuration -Check out our Postgresql document for a guide on optimizing Postgresql performance settings. +It is encouraged to check [Optimizing your Postgresql performance](../configuration/postgresql.md) document, for tips on PostgreSQL tuning. ```sh tab="Alpine" rc-service postgresql restart From af3568a6d99cbd73d1e685d7d2f57292ef951f43 Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 25 May 2020 19:26:07 +0200 Subject: [PATCH 3/3] Docs: sql -> SQL --- docs/configuration/postgresql.md | 6 +++--- docs/installation/otp_en.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/configuration/postgresql.md b/docs/configuration/postgresql.md index 068f133a9..6983fb459 100644 --- a/docs/configuration/postgresql.md +++ b/docs/configuration/postgresql.md @@ -1,6 +1,6 @@ -# Optimizing your Postgresql performance +# 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. +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. @@ -8,7 +8,7 @@ We also recommend not using the "Network Storage" option. ## Example configurations -Here are some configuration suggestions for Postgresql 10+. +Here are some configuration suggestions for PostgreSQL 10+. ### 1GB RAM, 1 CPU ``` diff --git a/docs/installation/otp_en.md b/docs/installation/otp_en.md index 6f9749ef1..86135cd20 100644 --- a/docs/installation/otp_en.md +++ b/docs/installation/otp_en.md @@ -63,7 +63,7 @@ apt install postgresql-11-rum ``` #### (Optional) Performance configuration -It is encouraged to check [Optimizing your Postgresql performance](../configuration/postgresql.md) document, for tips on PostgreSQL tuning. +It is encouraged to check [Optimizing your PostgreSQL performance](../configuration/postgresql.md) document, for tips on PostgreSQL tuning. ```sh tab="Alpine" rc-service postgresql restart