Skip to content

Commit d60a04b

Browse files
pablomhehelms
authored andcommitted
Set PostgreSQL tuning values
We can only set: - max_connections - shared_buffers - effective_cache_size Because they're the only ones exposed as configurable by the container image. Right now the ones missing from the non-containerized world would be: - checkpoint_completion_target - work_mem - autovacuum_vacuum_cost_limit - log_line_prefix - log_min_duration_statement - log_rotation_size
1 parent d6132be commit d60a04b

File tree

6 files changed

+18
-0
lines changed

6 files changed

+18
-0
lines changed

src/roles/postgresql/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ postgresql_admin_password: "CHANGEME"
1111

1212
postgresql_max_connections: 500
1313
postgresql_shared_buffers: 512MB
14+
postgresql_effective_cache_size: 1GB

src/roles/postgresql/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
env:
3535
POSTGRESQL_MAX_CONNECTIONS: "{{ postgresql_max_connections }}"
3636
POSTGRESQL_SHARED_BUFFERS: "{{ postgresql_shared_buffers }}"
37+
POSTGRESQL_EFFECTIVE_CACHE_SIZE: "{{ postgresql_effective_cache_size }}"
3738
quadlet_options:
3839
- |
3940
[Install]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
---
22
min_cpu_cores: 48
33
min_ram_mb: 262144
4+
5+
postgresql_max_connections: 1000
6+
postgresql_shared_buffers: 32GB
7+
postgresql_effective_cache_size: 64GB

src/vars/tuning/extra-large.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
---
22
min_cpu_cores: 32
33
min_ram_mb: 131072
4+
5+
postgresql_max_connections: 1000
6+
postgresql_shared_buffers: 16GB
7+
postgresql_effective_cache_size: 32GB

src/vars/tuning/large.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
---
22
min_cpu_cores: 16
33
min_ram_mb: 65536
4+
5+
postgresql_max_connections: 1000
6+
postgresql_shared_buffers: 8GB
7+
postgresql_effective_cache_size: 16GB

src/vars/tuning/medium.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
---
22
min_cpu_cores: 8
33
min_ram_mb: 32768
4+
5+
postgresql_max_connections: 1000
6+
postgresql_shared_buffers: 4GB
7+
postgresql_effective_cache_size: 8GB

0 commit comments

Comments
 (0)