postgres: Double maintenance_work_mem to 1/8th, but cap at 2GiB.

This is based on annotated.conf[^1].

[^1]: c4ebbf1420/postgresql.10.simple.conf (L122-L133)
This commit is contained in:
Alex Vandiver
2025-05-09 19:10:22 -04:00
committed by Tim Abbott
parent 8850c3f85c
commit 933871e825

View File

@@ -13,7 +13,7 @@ class zulip::profile::postgresql {
$work_mem = zulipconf('postgresql', 'work_mem', sprintf('%dMB', $total_postgres_memory_mb / 256))
$shared_buffers = zulipconf('postgresql', 'shared_buffers', sprintf('%dMB', $total_postgres_memory_mb / 4))
$effective_cache_size = zulipconf('postgresql', 'effective_cache_size', sprintf('%dMB', $total_postgres_memory_mb * 3 / 4))
$maintenance_work_mem = zulipconf('postgresql', 'maintenance_work_mem', sprintf('%dMB', $total_postgres_memory_mb / 16))
$maintenance_work_mem = zulipconf('postgresql', 'maintenance_work_mem', sprintf('%dMB', min(2048, $total_postgres_memory_mb / 8)))
$wal_buffers = zulipconf('postgresql', 'wal_buffers', undef)
$random_page_cost = zulipconf('postgresql', 'random_page_cost', undef)
$effective_io_concurrency = zulipconf('postgresql', 'effective_io_concurrency', undef)