From 7912a2547beb0762ca94adbc384ccb2f9b4d3f41 Mon Sep 17 00:00:00 2001 From: Tommy Date: Fri, 25 Aug 2023 17:37:31 -0700 Subject: [PATCH] Add postgres optimizations --- etc/postgresql/15/main/conf.d/10-custom.conf | 1 - .../15/main/conf.d/optimizations-general.conf | 11 +++++++++++ etc/postgresql/15/main/conf.d/optimizations-zfs.conf | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) delete mode 100644 etc/postgresql/15/main/conf.d/10-custom.conf create mode 100644 etc/postgresql/15/main/conf.d/optimizations-general.conf create mode 100644 etc/postgresql/15/main/conf.d/optimizations-zfs.conf diff --git a/etc/postgresql/15/main/conf.d/10-custom.conf b/etc/postgresql/15/main/conf.d/10-custom.conf deleted file mode 100644 index 9e5b149..0000000 --- a/etc/postgresql/15/main/conf.d/10-custom.conf +++ /dev/null @@ -1 +0,0 @@ -full_page_writes = off diff --git a/etc/postgresql/15/main/conf.d/optimizations-general.conf b/etc/postgresql/15/main/conf.d/optimizations-general.conf new file mode 100644 index 0000000..1e81c5d --- /dev/null +++ b/etc/postgresql/15/main/conf.d/optimizations-general.conf @@ -0,0 +1,11 @@ +# https://vadosware.io/post/everything-ive-seen-on-optimizing-postgres-on-zfs-on-linux/ +# https://www.percona.com/sites/default/files/presentations/pg-Performance-Tuning.pdf + +shared_buffers = 6GB +work_mem = 1GB +maintenance_work_mem = 1GB +effective_io_concurrency = 100 +max_worker_processes = 12 +max_parallel_workers = 12 +max_parellel_workers_per_gather = 3 +max_parellel_workers_per_gather = 3 \ No newline at end of file diff --git a/etc/postgresql/15/main/conf.d/optimizations-zfs.conf b/etc/postgresql/15/main/conf.d/optimizations-zfs.conf new file mode 100644 index 0000000..ac7a444 --- /dev/null +++ b/etc/postgresql/15/main/conf.d/optimizations-zfs.conf @@ -0,0 +1,6 @@ +# https://vadosware.io/post/everything-ive-seen-on-optimizing-postgres-on-zfs-on-linux/ + +full_page_writes = off +wal_init_zero = off +wal_recycle = off +effective_cache_size = 32GB \ No newline at end of file